DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

Wait until external program is finished to continue the script

I create a python script to analyze an excel file and export another excel file (X) as the result.

My vbscript needs to execute the python script and wait until it finished to read this X excel file to do further processing.

I have tried with:

Call ExtProgram()

and

Set oShell = CreateObject("Wscript.Shell")
oShell.Run exe & " " & PySc

where: exe is path of python engine and PySc is path of Python Script

With these, DIAdem could not wait until the python script finishes to continue its execution. As the result, DIAdem got an error because X excel file was not available for the next processing.

 

Is there anyway, excepting pausing the script with pause(), to make this happen?

Thank you

 

Hai

 

0 Kudos
Message 1 of 3
(8,468 Views)

Have your VBS script polling every x seconds/minuets on the folder to look for the X file using a "Do While" loop or something similar.  Exit that loop only if the file is available.  Possibly implement a timeout option.

0 Kudos
Message 2 of 3
(8,454 Views)

Just use the wait option of run?

 

 

dim wshshell : Set wshshell = WScript.CreateObject ("wscript.shell")
wshshell.run "c:\Windows\system32\cmd.exe", 6, True
set wshshell = nothing

 

0 Kudos
Message 3 of 3
(8,447 Views)