DIAdem

cancel
Showing results for 
Search instead for 
Did you mean: 

ExtProgram() non-blocking?

I'm calling ExtProgram() from within a VBScript. My VBScript program behaves as if it isn't waiting for ExtProgram() to return before continuing. Is this possible? I'm running under Windows XP, if that makes a difference.
0 Kudos
Message 1 of 2
(4,310 Views)
Hi vahugh,

That is the expected behavior of ExtProgram(). From the VBScript's perspective, It executes asynchronously and returns immediately. The VBScript does wait for the ExtProgram() funtion to return, but it does so immediately after it is done STARTING the application in question-- it knows nothing about how long that application will take to finish.

I can offer suggestions about possible ways to determine from the VBScript when the external application is done if you will tell me about the application that you are starting, but it will always involve VBScript polling a file or property or variable that the application sets.

If the application you wish to start is one which has an OLE Automation Server, such as Excel, LabVIEW, Internet Explor
er, etc., then you can create a VBScript object variable from that application's OLE Automation Server using the "CreateObject()" function, then execute ActiveX methods and query/set properties of the application's server from the VBScript. Many applications have the option of executing a method synchronously or asynchronously, so this might provide a superior measure of control to manipulating the application compared with the DOS command approach of "ExtProgram()".

Regards,
Brad Turpin
NI
Message 2 of 2
(4,310 Views)