I am trying to get a VBScript to launch another VBScript while passing an argument from the first one to the second one. I got the part of how to receive the argument on the sec
You need to initialize objShell
with
Set objShell = CreateObject("WScript.Shell")
before you can use its .Run
method.
Also, VBScript doesn't expand variables inside strings, so you'll need to concatenate your argument to the rest of the command string:
objShell.Run "ArgumentTest2.vbs " & arg1
Note that you'll need to put tokens in double quotes if they contain spaces:
arg1 = "My Argument"
objShell.Run "ArgumentTest2.vbs """ & arg1 & """"