Donate SIGN UP

Pausing a DOS script for a period of time

Avatar Image
philg | 19:44 Tue 07th Dec 2010 | Computers
5 Answers
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
Gravatar

Answers

1 to 5 of 5rss feed

Avatar Image
http://www.allenware....cswref.htm#WaitsFixed gives a few ways to do it, including the ping method
21:43 Tue 07th Dec 2010
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 5rss feed

Do you know the answer?

Pausing a DOS script for a period of time

Answer Question >>

Related Questions

Sorry, we can't find any related questions. Try using the search bar at the top of the page to search for some keywords, or choose a topic and submit your own question.