How to set delay in vbscript

前端 未结 11 1412
鱼传尺愫
鱼传尺愫 2020-12-03 09:35

How to set delay in vbscript?

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

11条回答
  •  暖寄归人
    2020-12-03 10:01

    If you're trying to simulate a sleep delay in VBScript but WScript is not available (eg: your script is called from Microsoft's BGInfo tool), then try the following approach.

    The example below will delay until 10 seconds from the moment the instruction is processed:

    Dim dteWait
    dteWait = DateAdd("s", 10, Now())
    Do Until (Now() > dteWait)
    Loop
    

提交回复
热议问题