0

I have this bat file to just kill and start the file, but I need a delay.

TASKKILL /F /IM "file.exe"
(what is the code to delay 1 minute before executing the code below?)
start /d "path" file.exe

Can you please help me? Thanks

damdeok
  • 63
  • 6

2 Answers2

2

You can use ping as @Krister suggested

ping 127.0.0.1 -n 60

of if you are using Vista and above you can use the much easier timeout

timeout /t 60
Bali C
  • 28,049
  • 34
  • 109
  • 147
1

I have used the ping command to achive this, you could ping an invalid host and set the timeout for the command to your desired delay.

@echo off
ping 1.2.3.4 -n 1 -w 60000 >NUL
# this command will be run after 60000ms
echo 'running';
pause
Cyclonecode
  • 26,179
  • 11
  • 66
  • 86