Link to home
Start Free TrialLog in
Avatar of ob1_
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?
Dim oShell, a 
oShell = CreateObject("Wscript.Shell") 
a = "C:\users\administrator\desktop\test.vbs" 
oShell.run(a, 3, True)

Open in new window

Avatar of jppinto
jppinto
Flag of Portugal image

Avatar of ob1_
ob1_

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.Shell")
a = "cscipt C:\users\administrator\desktop\test.vbs"
oShell.run(a, 3, True)
Avatar of ob1_

ASKER

i still get "cannot use parentheses when calling a sub" on the oShell.run(a, 3, True) line....
ASKER CERTIFIED SOLUTION
Avatar of ob1_
ob1_

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of ob1_

ASKER

found post with answer