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!

Simple Question....this way!! 1

Status
Not open for further replies.

dude123

MIS
Nov 15, 2001
2
US

Set oShell = CreateObject("Wscript.Shell")

oShell.Run ("c:\Program Files\TestFolder\test.exe")

The problem here is that the gap between 'Program Files' is causing an error. If I were to run this 'test.exe' file in a folder with one name, like so:

oShell.Run ("c:\Work\TestFolder\test.exe")

The statement executes without a problem.

I want to stick with 'Program Files' in my path. Is there any way possible I can use to make this work? Maybe place extra quotes? Let me know folks....thanks a lot

Dude
 
Hi,

or try:
Set oShell = CreateObject("Wscript.Shell")
path = "c:\Program Files\TestFolder\test.exe"
oShell.Run (path)

or:
oShell.Run("'c:\program files\testfolder\test.exe'")

Bye.
 
I'm not sure if this will work- but what about using the ASCII character for the space.

oShell.Run ("c:\Program%32Files\TestFolder\test.exe")

I'm not even sure if that is correct!!

Mise Le Meas,

Mighty :)
 
If there is an space in your path u must do like this

oShell.Run ("""c:\Program Files\TestFolder\test.exe"" parameters go here")

this means that if u use Run menu it's like
"c:\Program Files\TestFolder\test.exe" parameters go here
 
Awesome, the triple quotes did the job. Thanx for the input u guys.

Dude
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top