Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Pause VB script

Status
Not open for further replies.

coopsman

Technical User
Apr 5, 2002
9
US
I am trying to set up a script that will run a report, then pause 30 seconds, and then enter "Y". Is there a basic command to make the script wait or pause for a specified period of time? Thanks in advance.

Coopsman
 
I know in VB you can use this library,

Public Declare Sub Sleep Lib "kernel32" (ByVal dwmilliseconds As Long)

and then use the sleep command (ie sleep(<miliseconds>)) in your code, not sure if it works in VB script though
 
Try this example.


set WshShell = WScript.CreateObject(&quot;WScript.Shell&quot;)
WshShell.Run &quot;calc&quot;
WScript.Sleep 100
WshShell.AppActivate &quot;Calculator&quot;
WScript.Sleep 100
WshShell.SendKeys &quot;1{+}&quot;
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top