Use the "Run" method of the Shell Object, with the properties adjusted accordingly.
See the code below:
CreateObject("Wscript.Shell").Run """C:\Program Files\ABC\abc.xex""", 0, True
The first argument is the path of the executable (or vbs script).
The secret is the third argument, if it is True, it will wait until the command is over and then continue to the next line, without using Sleep(), in practice a synchronous call.
If you set to False, it already immediately continues running to next line, which is not what you want, in practice an asynchronous call.
The second argument is a number from 0 to 10, with the following intentions:
- Hide the window (and Activate Another window.)
- Activate and display the window. (Restore size and position) Specify this flag when Displaying a window for the first time.
- Activate & minimize.
- Activate & maximize.
- Restore. The active window remains active.
- Activate & Restore.
- Minimize & Activate the next top-level window in the Z order.
- Minimize. The active window remains active.
- Display the window in its Current state. The active window remains active.
- Restore & Activate. Specify this flag when Restoring a minimized window.
- Sets the show-state based on the state of the program that Started the application.
Jahwakening!
How do I know if it’s possible or not, without knowing which action/process to monitor to see if it’s over or not? Post the code.
– It Wasn't Me