Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

command script 3

Status
Not open for further replies.

ykfc

Programmer
Mar 6, 2004
66
0
0
AU
I need to create a command file (batch file) and run it from the command prompt. I am familiar how to create this.

However between two particular command lines, I want to insert a time gap between them so that the second command is only run, say one minute after the first one. Insert of creating something myself, I wonder if there is already a build-in Windows command for it.
 
ykfc,

PING will wait for a number of milliseconds between two PINGS before giving a time-out if the -w switch is used.

For example:
Code:
PING 1.1.1.1 -n 1 -w 60000 >NUL

will cause the execution to pause 60 seconds (60,000 milliseconds).

Just be sure that the address that you PING is NOT a valid address on your system.

Ed

Please let me know if the suggestion(s) I provide are helpful to you.
Sometimes you're the windshield... Sometimes you're the bug.
smallbug.gif
 
You can also break the batch file into 2 separate files. Determine how long it takes to run the first file, then schedule the second one to run a minute or two after that.

Matt J.

Please always take the time to backup any and all data before performing any actions suggested for ANY problem, regardless of how minor a change it might seem. Also test the backup to make sure it is intact.
 
What you can do is download the Microsoft 2000 Resource Kit or download just the sleep.exe from
The command you would use then is sleep #seconds

Ping site.com
sleep 15
ping site2.com
This would sleep for 15 seconds before ping site2

Or the other way to do it if you want to be prompted also is to use the timeout.exe. This is also in the resource kit or you can get it from
This will do the same function as sleep but also incase you want to sometimes run immediately you can just hit any key.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top