HomePage > Scripts > Sleep ten seconds

Sleep ten seconds

Tags:  

The sleep.exe command is, alas, not included by default on most editions of Windows. You can get it in a number of Resource Kits (here's one) but that can be a drag when your script needs to run on hosts which may or may not have it. Here's a simple workaround for your cmd scripts:

ping -w 1000 -n 10 0.0.0.0 >nul

It's just a ping of an always-bad address (0.0.0.0) with a wait time of 1 second (-w 1000), repeated 10 times (-n 10), and the output redirected to nul so it doesn't clutter up your screen.  Obviously you can change the -n parameter to whatever number of seconds you need. Or change the -w parameter, which is in milliseconds. There are 1000 milliseconds in 1 second.

0 Comments  Show recent to old
Post a comment


 RSS of this page