Waits for a specified amount of time in a batch file
Created: 30 Apr 2009 | 2 comments
Sometime in a batch file you need to wait to ensure that enough time is given for some operations to complete (installation, configuration, etc.)
There are some ways and tricks to put a pause, if you have a specific time a good solution is use the Sleep.exe utility.
This utility is available with the Windows Server 2003 Resource Kit Tools . Useful in batch files, Sleep.exe waits for a specified amount of time.
Usage:
sleep time-to-sleep-in-seconds
sleep [-m] time-to-sleep-in-milliseconds
sleep [-c] commited-memory ratio (1%-100%)
Example :
sleep 5 ( waits for 5 seconds )
The Endpoint Management Community Blog is the perfect place to share short, timely insights including product tips, news and other information relevant to the Endpoint Management community. Any authenticated Connect member can contribute to this blog.
Comments
Another solution
If you want something that can work with any windows OS you can also use this command
ping 127.0.0.1 -n 1 -w 1000 >nul
just replace the 1 in the "-n 1" with the number of seconds you want to wait.
Screenbert
Nice tip
It is very useful for me. Thanks Screenbert.
Thanks,
Eshwar
Would you like to reply?
Login or Register to post your comment.