Windows 10: Making CMD Go Away After Task Is Done

  1.    19 Mar 2016 #1

    Making CMD Go Away After Task Is Done


    I have a scheduled task set to run once per week. It executes a batch file that uses 7zip commands to zip a folder. It looks like:

    @echo off
    taskkill /im "plex media server.exe"
    7za u "D:\odrive\Amazon Cloud Drive\Plex\plexbackup.7z" D:\plexdata -mx0 -up1q0r2x1y2z1w2
    "C:\Program Files (x86)\Plex\Plex Media Server\plex media server.exe"
    The script works exactly as I want to, and it runs on schedule once per week in the middle of the night, according to the settings in Windows Task Scheduler. The final line that displays in the CMD window is "Everything is OK" which is the 7zip signal that everything went as expected. My problem is that the CMD window that displays the progress while the script is running does not disappear after it is done. This is annoying for me because the machine is a home theater PC, and the prompt appears on top of my home theater app. In order to get rid of it, I have to hook up my remote keyboard and mouse.

    How can I make the CMD window go away when it is done?

      My ComputerSystem Spec

  2. JohnC's Avatar
    Posts : 3
    Dual Boot 10 Pro v1607 10 Pro rs2 build 14971
       19 Mar 2016 #2

    Use exit as the last line of the script should do it.
      My ComputerSystem Spec

  3.    31 Mar 2016 #3

    Exit is not doing it.

    Normally typing exit in the CMD will shut it down, but in this case it doesn't.

    The last line displaying in the window is: "Everything is OK"

    It remains at that, so I don't think it is processing the exit command.

    There must be another way to make this happen.
      My ComputerSystem Spec

  4.    31 Mar 2016 #4

    7Zip returns after it's finished executing, Which means a command window will exit.

    Are you sure that Plex media server.exe isn't holding the command prompt open? Try this instead.

    TASKKILL /IM "plex media server.exe"
    7za u "D:\odrive\Amazon Cloud Drive\Plex\plexbackup.7z" D:\plexdata -mx0 -up1q0r2x1y2z1w2
    START "" /B "C:\Program Files (x86)\Plex\Plex Media Server\plex media server.exe"
      My ComputersSystem Spec

  5.    01 Apr 2016 #5

    Thanks. This worked. What is different about using the start command instead of just calling it?
      My ComputerSystem Spec


Related Threads
Making MSN go away. in Browsers and Email
So. At the moment, I have no working phone jacks in my house and am therefore throwing money at my neighbour while I wait for a tech to actually show up. This means that while my desktop is online, my HTPC is not: it lives in its own little world...
Making a new custom PC in PC Custom Builds and Overclocking
Hi, I'm new here. I'm previously from the Win8.1 forums. So, does my custom PC fully supports Windows 10? Here is the specs of my "wanna be" custom PC : CPU : Intel Core i7-5775C with Intel Iris Pro Graphics 6200 GPU : NVidia GeForce GTX 750 ti...
Is there a way to make the "Command Prompt" window show when I have a task running in Windows task Scheduler? I would like to be able to view the progress of the task. For example, I have a program called "Zap2xml" that collects TV EPG data. It...
My issue is kind of strange. I am an insider currently on Windows 10 build 10240. All the build I have tried so far has this same error in task scheduler when I change my time zone to my current location which is kathmandu (UTC+5:45). When i change...
Video making conversation in Chillout Room
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 15:56.
Find Us