CMD打开2个程序然后关闭第1个杀死另一个


0

我有两个exe文件我需要同时运行,当第一个关闭时关闭另一个。

start programA.exe
start programB.exe

onclose(programA.exe)
taskkill /im programB.exe

不工作。只是为了更容易理解。

Answers:


0
start notepad.exe
start /wait calc.exe
echo wait until calc.exe is finished
echo then kill notepad.exe
taskkill notepad.exe

注意:如果正在运行多个(在此示例中)记事本的实例,则可能会关闭错误的实例。

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.