Windows batch: killing processes

2019-03-05 16:51发布

I have several processes running which have the same name. I want to have an option to kill them from a batch script. I need something very similar to unix shell command:

kill -9 `ps -axuw | grep MY_PROCESS_NAME | awk '{print $2}'`

Any suggestions?

1条回答
Root(大扎)
2楼-- · 2019-03-05 16:52

You can use taskkill.

taskkill /im MY_PROCESS_NAME /f

That will kill all processes under the name you specify i.e. iexplore.exe

Type taskkill /? at a cmd prompt for all the options.

查看更多
登录 后发表回答