Run Exit/Quit?


  1. Posts : 1,364
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
       #1

    Run Exit/Quit?


    I know that doing a 'run pathname\programxyz.exe' will start a program. I would like to know what the command would be to exit/quit the program. Could it be something as simple as the same 'run' command with a '-quit' switch suffix?

    thnx
      My Computer


  2. Posts : 5,915
    Windows 10 Pro X64
       #2

    Have a look here

    Microsoft Corporation
      My Computer


  3. Posts : 1,364
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
    Thread Starter
       #3

    Dude said:
    MourningStar said:
    I know that doing a 'run pathname\programxyz.exe' will start a program. I would like to know what the command would be to exit/quit the program. Could it be something as simple as the same 'run' command with a '-quit' switch suffix?
    Have a look here

    Microsoft Corporation
    whoah, that page was greek to me.

    So, given the 'sample' above, would it be :

    taskkill pathname\programname.exe

    ?

    edit : no, that didn't work
    Last edited by MourningStar; 13 Aug 2013 at 10:17.
      My Computer


  4. Posts : 6,330
    Multi-Boot W7_Pro_x64 W8.1_Pro_x64 W10_Pro_x64 +Linux_VMs +Chromium_VM
       #4

    Hello MourningStar,

    I started MS Paint and created a BAT file to kill the task with this command:
    taskkill /IM mspaint.exe

    The /IM parameter is for specifying the imagename (listed in Task Manager).
      My Computer


  5. Posts : 1,364
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
    Thread Starter
       #5

    thnx David - can you help me create that same .bat file so I can test it on my computer? I assume I would then type that file into the 'run' dialogue?
      My Computer


  6. Posts : 17,545
    Windows 10 Pro x64 EN-GB
       #6

    To add to what David already told you: Taskkill does not "quit" a program per se, it ends a process. To do it, it needs to know either the process ID (PID) or its process image name, quite often but not always the same than the name of the program's exe file.

    An example. You have Windows Media Player running and want to stop it using Taskkill command. To do this you must first give the command (Taskkill), then using a so called switch to tell system if you will use the PID or process image name (/PID or /IM), and finally the respective PID or process image name.

    You can find both process image name and PID using command prompt with command Taskklist or in Task Manager:
    Run Exit/Quit?-2013-08-13_173847.png

    Notice that Task Manager does not show PIDs by default. To see the PIDs, use Task Manager's View Menu > Select Colums.

    To stop Windows Media Player using Taskkill command and process image name:
    taskkill /IM wmplayer.exe
    Notice that the path is not required and should not be added, simply just the process name.

    To stop Windows Media Player using Taskkill command and process ID:
    taskkill /PID 2400

    Kari
    Last edited by Kari; 19 Aug 2013 at 05:43. Reason: Really bad typo.
      My Computer


  7. Posts : 1,364
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
    Thread Starter
       #7

    Thank you Kari. I just learned that there also exists a 'kill' command. Is it same?
      My Computer


  8. Posts : 17,545
    Windows 10 Pro x64 EN-GB
       #8

    Taskkill is everything you need to kill processes using command prompt.

    Kill is a far more complicated PowerShell command to call (run) a cmdlet called Stop-Process and as such not recognized by or usable in command prompt. Basically it does nothing more than Taskkill.
      My Computer


  9. Posts : 1,364
    Microsoft Windows 7 Home Premium 64-bit 7601 Multiprocessor Free Service Pack 1
    Thread Starter
       #9

    ^
    Thnx again Kari - (o.t. just noticed your stats, I've been a serious Nightwish fan since their beginnings.)
      My Computer


  10. Posts : 17,545
    Windows 10 Pro x64 EN-GB
       #10

    You are welcome. I liked Nightwish when Anette Olzon was still with them but somehow lost interest after she left the band (was kicked out). What an incredible voice she has!
      My Computer


 

  Related Discussions
Our Sites
Site Links
About Us
Windows 7 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 7" and related materials are trademarks of Microsoft Corp.

© Designer Media Ltd
All times are GMT -5. The time now is 17:33.
Find Us