0
我有這個bat文件只是殺死和啓動文件,但我需要一個延遲。延遲代碼來啓動exe文件
TASKKILL /F /IM "file.exe"
(what is the code to delay 1 minute before executing the code below?)
start /d "path" file.exe
你能幫我嗎?謝謝
我有這個bat文件只是殺死和啓動文件,但我需要一個延遲。延遲代碼來啓動exe文件
TASKKILL /F /IM "file.exe"
(what is the code to delay 1 minute before executing the code below?)
start /d "path" file.exe
你能幫我嗎?謝謝
我已經使用ping
命令來實現這一點,你可以ping一個無效的主機,並將命令的超時設置爲所需的延遲。
@echo off
ping 1.2.3.4 -n 1 -w 60000 >NUL
# this command will be run after 60000ms
echo 'running';
pause
您可以使用ping
作爲@Krister建議
ping 127.0.0.1 -n 60
如果你正在使用Vista的
以上可以使用更容易timeout
timeout /t 60
http://stackoverflow.com /問題/ 1672338 /如何對睡眠爲-5秒合windowss-命令提示-或待辦事項 –