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

Start a program in program files folder

Status
Not open for further replies.

v081096

Programmer
Dec 8, 2002
1
SE
I have a problem trying to start an aplication, from within a vbscript using the run command, residing in the program files folder. I always get the error:
"The system can not find the file specified".
I have checked that the path is right using wscript.echo before I execute the wshShell.run command.
Can somebody help me ???
 
You need to be able to cope with the spaces between Program files, if you went to a DOS prompt and entered the same command it would probably error saying file not found, below is an example to fix this - this ex wraps " around the whole command, the same as running "c:\program files\textpad 4\textpad.exe" from the dos command prompt

dim wsh
Set wsh = CreateObject("Wscript.Shell")
wsh.run """c:\program files\textpad 4\textpad.exe""" Regards
Steve Friday
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top