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 wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loop until process is complete

Status
Not open for further replies.

lpb71

Technical User
Mar 10, 2004
57
GB
I have a script that shells out to the command prompt to run a process called lrep_reader.exe. How get my script to loop until this process is complete then continue with the rest of my script. My script currently checks to see is a file is increasing, however some hardwasre can't keepup and the file is not increasing within the time allowed, which is why I want my script to look if the process is still running rather than see if the file is still increasing.

Part of script below.

'Launch Progress screen
logfile.writeLine ("Entering first Loop")
Do Until FileSize1 = FileSize2
wscript.sleep 3000
'objDocument.WriteLn("File Size so far =" & (objFile0.Size)/1024 & " kb <br>")
'objDocument.Close
objDocument.Open
objDocument.WriteLn "<html><head><title>LREP Data Replication</title></head>"
objDocument.WriteLn "<body bgcolor='white'>"
objDocument.WriteLn "Replicating Data to USB Device. <br>"
objDocument.WriteLn "<br>"
objDocument.WriteLn "Please Wait....<p>"
FileSize1 = (objFile0.Size)
objDocument.WriteLn("File Size so far =" & (objFile0.Size)/1024 & " Kb <br>")
wscript.sleep 3000
FileSize2 = (objFile0.Size)
objDocument.Close
Loop
 
shells out to the command prompt to run a process
If you use the Run method then add True as 3rd argument.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
I also need an explorer screen to run alongside the cmd process. Is this possible?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top