Kill Multiple Running Processes Using a Batch File

Ever need to kill tasks multiple times from the task manager and would like to make a quick batch file to do it? Here is a quick and easy way to automate the process and save you some key strokes in the future.

Step 1 : Find the name of the process you need to kill

Compile a list of the processes you need to kill. If you do not know the name do the following :

  • Right click the task bar and select Start Task Manager
  • Select the Processes Tab
  • Find your process and copy the Image Name. If there is a *32 at the end of the process, ignore it.

Step 2 : Create and Setup your batch file

  • Create your file with a .bat extension so Windows will recognize it as a batch file
  • Enter as many lines as needed with the following format : TASKKILL /F /IM “[Application Name.exe]”
  • Save and run your batch file. It’s ok if any of those process are not running. It will return an error saying it cannot find the files, but will not crash and just move on to the next file.

Note : The F attribute is to tell Windows to forcibly terminate the process. The IM is telling Windows to use the Image Name to find the process to terminate it. You can use the process ID (/PID), but this would make the script useless to run again.Here is an example of what the batch file should look like :

TASKKILL /F /IM “ExampleApplication.exe”
TASKKILL /F /IM “Notepad++.exe”
TASKKILL /F /IM “Notepad.exe”

If you would like more information on killing the process, Microsoft has a reference :

Releated Post

Leave a Reply

%d bloggers like this: