Script file delay

  • Thread starter Thread starter John McD
  • Start date Start date
J

John McD

Can anyone tell me how to introdice a time delay between
initiating a script and the contents of the script being
activated? There isn't a batch command to do this but is
there a command line that could be inserted at the start
of the script file (.vbs)?
 
There is a batch file command to introduce a delay:

ping localhost -n 10 > nul

This will introduce a delay of about 10 seconds.
 
you can use the sleep command

Set WshShell = CreateObject("Wscript.Shell")
wscript.sleep 30000

Just so you know this would sleep 30 seconds as 1000 is 1
second.
 
First class trick
One for the notebook I think.
Cheers, J.
Johnnyo's device for inside the script works a treat too,
you guys are great.
 
Back
Top