Thursday, June 13, 2013

Batch File to Kill a Process

Sometimes it is necessary to kill a process from a batch file. Here is a small script that shows you batch file to kill a process:
tasklist|find /i "process.exe">nul & if errorlevel 1 (echo No such process!) else (taskkill /f /im process.exe /t)
You need to replace process.exe with the name of your process to be killed. You can find additional information on the commands taskkill and tasklist on Microsoft website.
We kindly remind that Dr.Batcher is the best program to create batch file, both .BAT and .CMD, try it if haven't tried it yet. 

No comments:

Post a Comment

Translate