I have a VBScript script that runs a second VBScript script. The second VBScript script asks some questions from the input box. My problem is that “MyShell.Run” does not wait until SecondVBscript.vbs has ended. And the other VBScript syntax run immodestly also
I need to wait for the MyShell.Run process to end and then perform the other VBScript syntax. How can I do that?
Set MyShell = Wscript.CreateObject("WScript.Shell")
MyShell.Run " C:\Program Files\SecondVBscript.vbs"
Set MyShell = Nothing
Other VBScript syntax
The
Runmethod has an optional argumentbWaitOnReturn, if you set that to true, won’t it wait then?See here for the documentation of the
Runcommand.