tags:

views:

343

answers:

1

How do I get a vbscript to run another vbscript?

Id imagine its only a few lines of code but not tried doing this before, nothing is passed between the 2, one just needs to call/run the other.

For examples the script being run is called TestScript.vbs, the other script for it to call/run would be called Secondscript.vbs, both of which are located in C:\Temp.

Thanks Mark

+3  A: 

See if the following works

Dim objShell
Set objShell = Wscript.CreateObject("WScript.Shell")

objShell.Run "TestScript.vbs" 

objShell = Nothing
Martin
Tried this, variable undefined, do I need to add a declaration for it as well?
markdigi
Ignore my original response - it was garbage. Hopefully the above will solve your issue.
Martin