Can the below programming structure is possible in VBScript.Where ProgA will start and after some lines of execution,it will give birth two procsses say ProgB and ProgC.When these child .vbs will be done,then Parent program ProgA will resume its execution and will finish its taks
ProgA.VBS
|
-------------------------------------------------
| |
ProgB.VBS ProgC.VBS
thanks,
Read about then .Run and .Exec methods of the WshShell object (
CreateObject("Wscript.Shell")). Make sure you pay attention to thebWaitOnReturnparameter to .Run and the .Status (and .Exitcode) properties of the WshScriptExec object. This answer contains sample code for .Run and .Exec.Update:
a.vbs (not production quality code!):
.Runs b.vbs:
and .Execs c.vbs:
output:
The MsgBoxes will prove that a.vbs waits for b.vbs and c.vbs.
Update II – VBScript’s MultiProcessing ((c) @DanielCook):
ax.vbs:
.Execs bx.vbs
and cx.vbs:
Don’t do this at work without a lot of further effort invested in error handling.