ob1_
asked on
calling a Vbscript from a Vbscript
i am getting an error when using the code below that says "Cannot use parentheses when calling a sub".
what is the correct way to call a new vbscript from an existing vbscript?
what is the correct way to call a new vbscript from an existing vbscript?
Dim oShell, a
oShell = CreateObject("Wscript.Shell")
a = "C:\users\administrator\desktop\test.vbs"
oShell.run(a, 3, True)
ASKER
not sure that will work. my main script is a VBS file not a WSF file and i am not trying to pull a function from another script but pass some variables onto the 2nd script via arguments and then execute the whole thing.
try:
Dim oShell, a
oShell = CreateObject("Wscript.Shel l")
a = "cscipt C:\users\administrator\des ktop\test. vbs"
oShell.run(a, 3, True)
Dim oShell, a
oShell = CreateObject("Wscript.Shel
a = "cscipt C:\users\administrator\des
oShell.run(a, 3, True)
ASKER
i still get "cannot use parentheses when calling a sub" on the oShell.run(a, 3, True) line....
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
found post with answer
https://www.experts-exchange.com/questions/24545612/Calling-An-External-VBScript-Function-Routine-With-Return-Parameters.html
jppinto