Need to create a 60 minutes delay in my DOS script
Moderator: DosItHelp
Need to create a 60 minutes delay in my DOS script
Hi everyone
I know I can delay from 5 to 99 seconds using the command line below:
TYPE NUL | CHOICE.COM /N /CY /TY,5 >NUL --> it delays for 5 secs
But I am not sure if it is feasible by any other means, to delay as long as 60 minutes.
I'd appreciate if anyone who has had such request before, could put me in the right direction.
Thank you in advance
tropics
I know I can delay from 5 to 99 seconds using the command line below:
TYPE NUL | CHOICE.COM /N /CY /TY,5 >NUL --> it delays for 5 secs
But I am not sure if it is feasible by any other means, to delay as long as 60 minutes.
I'd appreciate if anyone who has had such request before, could put me in the right direction.
Thank you in advance
tropics
-
- Expert
- Posts: 391
- Joined: 19 Mar 2009 08:47
- Location: Iowa
ping /?tropics wrote:why ping and what the args mean?
If you wanted a delay for 5 minutes, you had to write ittropics wrote:I replaced 999 with 5...
Code: Select all
ping -w 1000 -n 300 127.0.0.1 >nul
Another way to delay using VBS in batch
Code: Select all
:: begin of batch
echo wscript.sleep wscript.arguments(0)>sleep.vbs
:: ... some code ...
:: delay 1 sec
cscript sleep.vbs 1000 > nul
:: ... some code ...
:: delay 5 min
cscript sleep.vbs 300000 > nul
:: ... some code ...
:: delay 60 min
cscript sleep.vbs 3600000 > nul
:: ... some code ...
del sleep.vbs
:: end of batch
Windows 2003 and above all have a command called WAITFOR that can be used to pause for up to 99999 seconds. Its actually used to have server1 wait for a process on server2 to finish, once server2 finishes its process, it broadcast the 'signal' across the network to server1 and then server1 begins/continues processing.
The syntax when using as a pause is
WAITFOR Nothing /t 3600
where "Nothing" is the signal to waitfor, and /t xxx is how long the server will wait for that command.
...v
The syntax when using as a pause is
WAITFOR Nothing /t 3600
where "Nothing" is the signal to waitfor, and /t xxx is how long the server will wait for that command.
...v
-
- Expert
- Posts: 391
- Joined: 19 Mar 2009 08:47
- Location: Iowa
-
- Expert
- Posts: 391
- Joined: 19 Mar 2009 08:47
- Location: Iowa
Re: Need to create a 60 minutes delay in my DOS script
It's not like it's very accurate anyway.