How to set delay in vbscript

Mark picture Mark · Nov 13, 2009 · Viewed 572k times · Source

How to set delay in vbscript?

WScript.Sleep(100) does not work on Windows XP, Vista.

Answer

badbod99 picture badbod99 · Nov 13, 2009

Work this end (XP).

Create a new file, call it test.vbs. Put this in it.

WScript.Sleep 1000
MsgBox "TEST"

Run it, notice the delay before the message box is shown.

Note, the number is in Milliseconds, so 1000 is 1 second.