Pausing a DOS script for a period of time

I'm sure I once knew how to do this....

I need to pause a DOS script for a set period of time (say 10 seconds)

I was hoping that PAUSE would take a time delay as a parameter (it doesn't) or that there'd be a SLEEP command (there isn't)

So how DO I suspend a batch script for a defined period of time?

Thanks

Phil G
20:44 Tue 07th Dec 2010
 
Avatar Image
Huderon
Best Answer
http://www.allenware....cswref.htm#WaitsFixed gives a few ways to do it, including the ping method
22:43 Tue 07th Dec 2010 Go To Best Answer

1 to 5 of 5

wasn't there a command called WAIT?
I think pause just waits for a key to be pressed
Question Author
Nope - no WAIT command either :(

and yes, PAUSE does just wait for a keypress

Bother
SLEEP and WAIT commands do exist but were not standard in DOS.

You could always PING localhost

ping 127.0.0.1 -n 5 >nul
http://www.allenware....cswref.htm#WaitsFixed gives a few ways to do it, including the ping method
Question Author
Thanks Huderon - perfact

1 to 5 of 5

Latest posts