2

Is there a command line way of stopping a process if I know the name of the exe (or better give a wildcard). I was about to jump in and write an autohotkey script to do it but I thought I would look for out of the box ways first.

Interested in Windows XP and Vista.

justintime
  • 3,201
  • 5
  • 29
  • 33
  • 1
    http://superuser.com/questions/52159/kill-a-process-with-a-specific-command-line-from-command-line – random Apr 04 '10 at 14:34
  • 1
    Thanks @random. I did have a look for similar but used "stop" rather than "kill" so didnt see that one. Ho hum! – justintime Apr 04 '10 at 14:42

3 Answers3

7

Solution

You can use the taskkill command.

Note: The command is not available in Windows XP Home/Starter Edition.

Examples

taskkill /IM app.exe
taskkill /IM app*.exe

Further reading

Wasif
  • 7,984
  • 2
  • 19
  • 32
Synetech
  • 68,243
  • 36
  • 223
  • 356
2

With PowerShell, you can use Stop-Process supplying either an id or name

Scott Weinstein
  • 754
  • 3
  • 13
  • 32
  • 1
    Note however, that PowerShell is not supplied with the operating system for both XP and Vista. – Joey Apr 04 '10 at 15:30
0

You can use wmic (Which uses WMI):

wmic process where "NAME like '%PROCESS_NAME%'" call terminate
Wasif
  • 7,984
  • 2
  • 19
  • 32