A similar question appeared earlier this week. I guess some code just never dies.
@echo off
:loop
for /f "tokens=1 skip=3" %%f in ('tasklist') do (
if /i .%%f equ .%1 taskkill /im %1 /f
)
if not .%2==. (
shift
goto loop
)
Save the above snippet with a
bat extension. You can then run your batch file to kill any number of jobs named on the command line.
ie: If you saved the file as
RunTheKill, you could run it as:
RunTheKill excel.exe iexplore.exe
Both Excel and Internet Explorer will be killed.
Good luck.