Wait for the second VBScript script until ended from primary VBScript script
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 Run
method has an optional argument bWaitOnReturn
, if you set that to true, won't it wait then?
See here for the documentation of the Run
command.
If I get you correctly, you can make your script wait at certain point using sleep
method of WScript object:
MyShell.Sleep(12000)
精彩评论