Hello All VBScript GURU's:

Is it possible to run a vbscript that can run or call another vbscript and
wait until that script finishes running before continuing on? I am new to
vbscript. I have a DOS/NT script that does the samething but need it in
vbscript.

Thanks
Argus

Re: VBScript to call another VB by McKirahan

McKirahan
Fri Sep 15 17:40:41 CDT 2006

"OdAwG" <OdaWg@goneloose.com> wrote in message
news:4sFOg.1093$LH2.729@tornado.texas.rr.com...
> Hello All VBScript GURU's:
>
> Is it possible to run a vbscript that can run or call another vbscript and
> wait until that script finishes running before continuing on? I am new to
> vbscript. I have a DOS/NT script that does the samething but need it in
> vbscript.


Will this help?


Option Explicit
Const cVBS = "script1.vbs"
MsgBox "#1",vbInformation,cVBS
Dim strWSS
strWSS = "%comspec% /C cscript script2.vbs"
Dim objWSS
Set objWSS = CreateObject("WScript.Shell")
objWSS.Run strWSS,7,True
Set objWSS = Nothing
MsgBox "#3",vbQuestion,cVBS



Option Explicit
Const cVBS = "script2.vbs"
MsgBox "#2",vbExclamation,cVBS


"The Run method also accepts a Boolean value as a third
parameter that determines whether the script pauses until
the called program is finished running or instead continues
with the next command in the script. If this value is set to
False (the default), the Run method simply issues the
command to run the program but does not check to ensure
that the program actually ran.

If the third parameter is set to True, the script will wait for
the program to finish running, return the integer exit code
provided by the program, and then continue with the next
line of the script."

URL:http://www.microsoft.com/technet/scriptcenter/guide/sas_wsh_pkoy.mspx


URL:http://www.microsoft.com/technet/scriptcenter/guide/default.mspx?mfr=tru
e

URL:http://www.microsoft.com/technet/scriptcenter/resources/qanda/nov05/hey1
111.mspx

URL:http://www.microsoft.com/technet/scriptcenter/resources/qanda/oct05/hey1
031.mspx