tags:

views:

2115

answers:

4

Hi,

How to set delay in vbscript??

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

Any help!

A: 

Check out this thread. You can also use the Timer in a loop to check yourself how much time has elapsed and break the loop when the value you want to is reached.

luvieere
+2  A: 

if it is VBScript, it should be

WScript.Sleep 100

If it is javascript

WScript.Sleep(100);
Jeeva S
Actually with only one param, both methods work in VBScript
badbod99
+2  A: 

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.

badbod99
+2  A: 

Time of Sleep Function is in milliseconds (ms)

if you want 3 minutes, thats the way to do it:

WScript.Sleep(1000 * 60 * 3)
Nadir SOUALEM