从bat文件关闭chrome [英] Close chrome from bat file
问题描述
我正在尝试从bat文件中删除Chrome.试过
I am trying to kill chrome from bat file. Tried
TASKKILL /IM chrome.exe /F
但是它不会关闭镶边.正确的方法是什么?
but it doesnt close the chrome. What is the correct way to do that ?
推荐答案
您将要使用相同的命令,但要使用/T参数,例如:
You'll want to use the same command, but with the /T argument, like so:
taskkill /F /IM chrome.exe /T
/T参数杀死该进程及其所有子进程.实际上,它应该关闭所有与您在参数列表中提供的进程名称相同的进程.
The /T argument kills the process and all of its child processes. Effectively, it should close all processes with the same process name that you provide in the argument list.
如果您想抑制错误/输出,则将输出通过管道传输到nul,如下所示:
If you'd like to suppress errors/output, pipe the ouput to nul, like this:
taskkill /F /IM chrome.exe /T > nul
无论使用哪种方法,都必须以管理员身份运行批处理文件以杀死chrome.exe进程.
Regardless of the method you use, you must run the batch file as an Administrator to kill the chrome.exe processes.
这篇关于从bat文件关闭chrome的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!