Kinook Software Forum

Go Back   Kinook Software Forum > Visual Build Professional > [VBP] General Discussion

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 05-16-2004, 11:02 AM
mishka mishka is online now
Registered User
 
Join Date: 12-07-2003
Posts: 5
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..
Reply With Quote
  #2  
Old 05-17-2004, 08:15 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
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
Reply With Quote
  #3  
Old 05-17-2004, 08:47 AM
mishka mishka is online now
Registered User
 
Join Date: 12-07-2003
Posts: 5
Thumbs down

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..
Reply With Quote
  #4  
Old 05-17-2004, 09:07 AM
kinook kinook is online now
Administrator
 
Join Date: 03-06-2001
Location: Colorado
Posts: 6,034
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"
Reply With Quote
  #5  
Old 05-17-2004, 09:14 AM
mishka mishka is online now
Registered User
 
Join Date: 12-07-2003
Posts: 5
yes, that's what I did actually.
Just wanted to check if this can be done inside VisualPro project..
Thanks.
Reply With Quote
Reply

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



All times are GMT -5. The time now is 08:13 PM.


Copyright © 1999-2023 Kinook Software, Inc.