mgjust
asked on
A method to cue multiple script sequential execution.
Hello,
Is there a way to have scripts run sequentially with just one act of execution (pardon my jargon or lack thereof)? To be clear: Have a script execute only after the previous has finished?
Thanks,
MJ
Is there a way to have scripts run sequentially with just one act of execution (pardon my jargon or lack thereof)? To be clear: Have a script execute only after the previous has finished?
Thanks,
MJ
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thank you kindly.
'===================
'MUST BE RUN BY: START /WAIT RunAndWait.vbs script1.vbs script2.vbs
If WScript.Arguments.Count > 0 Then
strWhileCondition = "Do Until "
Set wshShell = CreateObject("WScript.Shel
For intArgNum = 0 To WScript.Arguments.Count - 1
strCodeToExec = "Set objExec" & intArgNum & " = wshShell.Exec(""wscript.ex
Execute strCodeToExec
If intArgNum < WScript.Arguments.Count - 1 Then
strWhileCondition = strWhileCondition & "objExec" & intArgNum & ".Status AND "
Else
strWhileCondition = strWhileCondition & "objExec" & intArgNum & ".Status"
End If
Next
strWhileCondition = strWhileCondition & VbCrLf & "WScript.Sleep 500" & VbCrLf & "Loop"
'MsgBox strWhileCondition
Execute strWhileCondition
End If
'===================
And you can use it in a batch file like this:
@echo off
start /wait RunAndWait.vbs file1.vbs file2.vbs file3.vbs
start /wait RunAndWait.vbs file4.vbs
Regards,
Rob.