Photo Gallery Member List Search Calendars FAQ Ticket List Log Out


Sleep on Loop not working!!

 
Logged in as: Guest
arrSession:exec spGetSession 2,2,59734
 Active Users: There are 0 members and 0 guests.
 Users viewing this topic: none
 

 

 
  
  Printable Version
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Sleep on Loop not working!!
  Do you like VisualBasicScript.com? Link to us and help spread the word about our forum. Thanks!
Page: [1]
Login
Message << Older Topic   Newer Topic >>
 Sleep on Loop not working!! - 5/1/2008 10:56:32 AM   
  careytech

 

Posts: 3
Score: 0
Joined: 8/9/2007
Status: offline
Folks,

I'm a newbie so I ask for your patience firstly.

I'm trying to create a script that will check for a folder, if it doesn't exist run an install, sleep and loop until it has finished Then Echo "Finished".

There's a lot more I've done that works, but I can't get the sleep to work - Any Ideas?


Option
Explicit
Dim
WshFS, WshShell, oExec

Dim
strSourcePath

'On Error Resume Next

Set
WshFS = WScript.CreateObject ("Scripting.FileSystemObject")

Set
WshShell = WScript.CreateObject("WScript.Shell")
strSourcePath = Left(WScript.ScriptFullName,
Len(WScript.ScriptFullName) - Len(WScript.ScriptName))

If
Not WshFS.FolderExists("c:\program files\Early Years Maths Pack") Then
Set
oExec = WshShell.Exec (strSourcePath & "Maths\setup1.exe /s")
Do While oExec.Status = 0
WScript.Sleep 100
Loop

Wscript.Echo
"Finished"

End
If
 
 
Post #: 1
 
 RE: Sleep on Loop not working!! - 5/1/2008 1:23:55 PM   
  dm_4ever


Posts: 2432
Score: 38
Joined: 6/29/2006
From: Orange County, California
Status: offline
How do you know the sleep is not working? Are you sure the executable is being executed?  Maybe try something simple like this to see f your script is even reaching the Do...Loop

Do While oExec.Status = 0
   WScript.Echo Now()
   WScript.Sleep 1000
Loop

_____________________________

dm_4ever

My philosophy: K.I.S.S - Keep It Simple Stupid
Read Me: http://www.visualbasicscript.com/m_24727/tm.htm
Frequently Asked Stuff: http://www.visualbasicscript.com/m_47117/tm.htm

(in reply to careytech)
 
 
Post #: 2
 
 
 
  

If you found our site useful please link to us <a href="http://www.visualbasicscript.com">VisualBasicScript.com</a>.
All Forums >> [Scripting] >> WSH & Client Side VBScript >> Sleep on Loop not working!! Page: [1]
Jump to:





New Messages No New Messages
Hot Topic w/ New Messages Hot Topic w/o New Messages
Locked w/ New Messages Locked w/o New Messages
 Post New Thread
 Reply to Message
 Post New Poll
 Submit Vote
 Delete My Own Post
 Delete My Own Thread
 Rate Posts