Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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?

like image 659
codeLes Avatar asked Aug 29 '08 02:08

codeLes


People also ask

How do you make a batch file that stops a program?

bat add the following code: call taskkillapp. bat [filenamehere] . And to taskkill.

How can kill process in cmd?

There are two commands used to kill a process: kill – Kill a process by ID. killall – Kill a process by name.


2 Answers

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.

like image 130
Factor Mystic Avatar answered Sep 26 '22 17:09

Factor Mystic


taskkill /f /im "devenv.exe"

this will forcibly kill the pid with the exe name "devenv.exe"

equivalent to -9 on the nix'y kill command

like image 43
DevelopingChris Avatar answered Sep 25 '22 17:09

DevelopingChris