Any way to write a Windows .bat file to kill processes?

codeLes picture codeLes · Aug 29, 2008 · Viewed 326.6k times · Source

Every time I turn on my company-owned development machine, I have to kill 10+ processes using the Task Manager or any other process management app just to get decent performance out of my IDE. Yes, these are processes from programs that my company installs on my machine for security and compliance. What I'd like to do is have a .bat file or script of some kind with which I can kill the processes in question.

Does anybody know how to do this?

Answer

Factor Mystic picture Factor Mystic · Aug 29, 2008

You can do this with 'taskkill'. With the /IM parameter, you can specify image names.

Example:

taskkill /im somecorporateprocess.exe

You can also do this to 'force' kill:

Example:

taskkill /f /im somecorporateprocess.exe

Just add one line per process you want to kill, save it as a .bat file, and add in your startup directory. Problem solved!

If this is a legacy system, PsKill will do the same.