我想要这样的东西:-
taskkill 7z.exe after 50sec.
Execute few lines of codes without waiting for 7z.exe to be killed.
无论执行在哪里,它都会在 50 秒后自动被杀死。
最佳答案
这就是你的意思吗?等待 50 秒后再杀死 7z.exe
Timeout 50
taskill /f /im 7z.exe
或者你想在杀死后等待然后执行一些命令。
taskill /f /im 7z.exe
Timeout 50
REM do commands here.
编辑:OP的新版本。
start "7z killer" cmd "/c Timeout 50 && taskkill.exe /f /im 7z.exe"
echo "do something immediately"
关于batch-file - Bat 中超时的 Taskkill,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21166364/