问题描述
我有一个 .cmd
文件,通过以下文件调用该文件来打开命令提示符
的多个实例:
I have a .cmd
file which I call to open multiple instances of Command Prompt
via:
launcher.cmd -fs
launcher.cmd -tds
launcher.cmd -fsd
每个命令打开一个新命令提示符。
Each command open a new command prompt.
所以我要做的是创建一个批处理文件,以自动关闭所有打开的命令提示符
,而不是手动关闭
So what I want to do is create a batch file to automatically close all the opened Command Prompt
instead of manually doing it.
推荐答案
请小心:您可能杀死比自己想要的进程更多的进程:
Be carefull: you might kill more processes than you want:
taskkill /IM cmd.exe
您可以添加额外的过滤器:
You can add extra filters:
taskkill /IM cmd.exe /FI "WINDOWTITLE eq launcher*"
使用
一目了然.exe进程将执行taskkill操作。
to get a glimpse of what cmd.exe processes will be taskkill-ed
您可以添加/ F参数以强制关闭进程,但我只会在进程不响应的情况下使用它正常的请求。
You could add the /F parameter to force the process to close but I would only use that if the process doesn't respond to a normal request.
这篇关于批处理脚本关闭所有打开的命令提示符窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!