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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Launch a program script 2

Status
Not open for further replies.

thec0dy

IS-IT--Management
Apr 16, 2010
41
US
I am trying to get a program to launch with commands. Below I have what needs to be called. I can run it in the run box fine, but putting it into a script it either gets some of it, or errors out because it doesn't like all the " " ". Can someone let me know what I need to do to make this work?

"C:\Program Files (x86)\Blah\Blahs\3.0.18\Client\BlahClient.exe" -s="AppServer7" -i="DBName" -w="C:\temp"


Thanks!
 
Hi Thec0dy,

What have you tried so far? Let me know and I'll help you.


Thanks,
FOXUP!


 
Hey,

Did U try this:


strProgramPath = "C:\Program Files (x86)\Blah\Blahs\3.0.18\Client\BlahClient.exe" -s="AppServer7" -i="DBName" -w="C:\temp"
set objShell = createobject("Wscript.Shell")
objShell.Run strProgramPath


Put that in a text file called "run_myprog.vbs", doubleclick it, and it will run your program.

Let me know if it works.


Thanks,
FOXUP!

 
Let me know if it works
It shouldn't.
I'd try this instead:
strProgramPath = """C:\Program Files (x86)\Blah\Blahs\3.0.18\Client\BlahClient.exe"" -s=""AppServer7"" -i=""DBName"" -w=""C:\temp"""

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Thanks FOXUP,

I tried that and when I launch I get the following error:

Line: 1
Char: 1
Error: Type mismatch: '[string: "C:\Program Files (x8"]'
Code: 800A000D
Source: Microsoft VBScript runtime error
 
Thanks PHV it is working. I always forget about those double "".
 
You need to double all of the double-quotes then surround the whole thing with one set of double-quotes, which is exactly what PHV posted.
 
Yeah, there you go! Double quotes and BINGO! Nice guys. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top