Link to home
Start Free TrialLog in
Avatar of JamesonJendreas
JamesonJendreas

asked on

Vbscript - Run an Executable w/ arguments

This hopefully should be easy, but it's been years since I've scripted anything .  WHat I am tryign to do - prompt users for an IP address, then pass that IP address to a simple executable.

The syntax at the cli is flash.exe -s <IPADDRESS>

Dim objshell, strSwitchIP
strSwitchIP = InputBox ("Entrer IP Address")
Set objshell = Wscript.CreateObject ("Wscript.Shell")
objshell.run("""c:\flash.exe"" -s strSwitchIP""" 
Set objshell = Nothing

Open in new window


Am I on the right track?  I assume the issue is syntax with the quotes?  Or is this not really possible?
Avatar of dustock
dustock
Flag of United States of America image

Line 4 is missing the closing parenthesis

should be like this
objshell.run("""c:\flash.exe"" -s strSwitchIP""")

Open in new window

Avatar of JamesonJendreas
JamesonJendreas

ASKER

Grr, that what I get for not copy/paste (its in a VM).   I actually have the closing ) on my actual script
Dim objshell, strSwitchIP
strSwitchIP = InputBox ("Entrer IP Address")
Set objshell = Wscript.CreateObject ("Wscript.Shell")
objshell.run("""c:\flash.exe"" -s strSwitchIP""")
Set objshell = Nothing

Open in new window

Dim objshell, strSwitchIP
strSwitchIP = InputBox ("Entrer IP Address")
Set objshell = Wscript.CreateObject ("Wscript.Shell")
objshell.run("""c:\flash.exe"" -s strSwitchIP""")
Set objshell = Nothing
ASKER CERTIFIED SOLUTION
Avatar of oBdA
oBdA

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