Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How To Call VBS from another VBS w/ Named Params 1

Status
Not open for further replies.

benmillus

Programmer
Jun 17, 2003
18
US
Here is the issue:

Need to call a vbs using another vbs. Last vbs to be called can also be call from command line using:

"c:\scrpts\myVBS.vbs" /param1:"c:\scripts\log.txt" /param2:"Val2" /param3:"Val3" /param4:"Val4"

This works fine. But when attempting to execute via another vbs it fails. I have tried many different variations but this will give the idea:

Set Shell = CreateObject("WScript.Shell")
Shell.Run "c:\scrpts\myVBS.vbs" /param1:"c:\scripts\log.txt" /param2:"Val2" /param3:"Val3" /param4:"Val4"
 
Shell.Run """c:\scrpts\myVBS.vbs"" /param1:""c:\scripts\log.txt"" /param2:""Val2"" /param3:""Val3"" /param4:""Val4"""

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top