Close a running application from DOS command line

niko picture niko · Jul 15, 2011 · Viewed 95.4k times · Source

The start command can launch an application like notepad in a batch file like this:

start notepad
start "my love.mp3"

But how do I close the running application from the command line? I found taskkill in my searches but I don't think that is the right command because it's not working—it says no such file.

How do I close an application launched with start?

Answer

Patrick Cuff picture Patrick Cuff · Jul 15, 2011

Enter taskkill /? for the syntax and some examples. What you want to do is pass the /IM argument using the name of the program you want to kill. For example:

TASKKILL /F /IM notepad.exe

will kill notepad.exe.

TASKKILL /F /IM note*

will kill all processes beginning with "note".