求一windows bat脚本,自动打开一个程序,过X秒后再关闭这个程序。

求一windows bat脚本,自动打开一个程序,过X秒后再关闭这个程序。

第1个回答  2012-02-21
@echo off
start 具体路径\a.exe
choice /c 12 /d 1 /t 10>nul
taskkill /f /im a.exe
exit
上面的/t 后面的数字代表暂停的时间
第2个回答  2012-02-16
@echo off
test.exe
timeout /t x /nobreak>nul
taskkill /f /im test.exe追问

你的脚本最后不会关闭程序 单独运行taskkill /f /im test.exe倒是可以

本回答被网友采纳
第3个回答  2012-02-19
来个鱼死网破-加个if判断。嘻嘻。。。
@echo off
test.exe
:a
timeout /t x /nobreak>nul
taskkill /im test.exe /f
tasklist /nh|find /i "test.exe" if ERRORLEVEL 1 (goto a) else (goto exit)
相似回答