|
#1
|
|||
|
|||
sleep in VBScript
Hello
Maybe its trivial but I fail to insert a sleep into a VBScript.. I've tried following pieces of code in "Run Script" action: Sleep("200") Sleep(200) Sleep 200 Set shell = CreateObject("WScript.Shell") Sleep("200") Set shell = CreateObject("WScript.Shell") Sleep(200) Set shell = CreateObject("WScript.Shell") Sleep 200 Please help.. |
#2
|
|||
|
|||
Sleep is provided by the Windows Script Host (WSH) and is not available in VBP (which is a script host itself and does not use WSH). To get a one second delay, you could use:
Wait 1 Function Wait(sec) start = Timer Do While Timer-start < sec ' no-op Loop End Function |
#3
|
|||
|
|||
not good
CPU jumps to 99% when I'm doing this "sleep" actually I'm trying to build a step that will perform automatic signing of executables with signcode.exe. I'm starting it with WScript's Run method and enter password with SendKeys method. If I'm using your sleep I never see the dialog, it does not receives enough CPU to run.. |
#4
|
|||
|
|||
You could write your script code to a .vbs file and call it from a Run Program action, running it under WSH so that Sleep will be available:
cscript "drive:\path\to\file.vbs" |
#5
|
|||
|
|||
yes, that's what I did actually.
Just wanted to check if this can be done inside VisualPro project.. Thanks. |
Thread Tools | |
Display Modes | Rate This Thread |
|
|