用vbs打开A程序,然后在手动关闭A程序后,关闭B,C进程!

2025-04-26 19:41:58
推荐回答(1个)
回答1:

使用 Run方法的第三个参数,等待命令执行完成后才返回。

Set ws = CreateObject("WScript.Shell")
ws.Run "A", 0, true  '运行A程序
ws.Run "taskkill /f /im B.exe", 0, true   '关闭B程序
ws.Run "taskkill /f /im C.exe",0, true  '关闭C程序