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!

objShell.Run Problem ..Please Help

Status
Not open for further replies.

stephenmbell

IS-IT--Management
Jan 7, 2004
109
0
0
US
I am sure this question has been addressed plenty of times but I have googled it for a while now, and still cannot get it to work...

why does this script not run the AIM program..

Dim objShell, strPath
strPath = """C:\Program Files\AIM6\aim6.exe"""
MsgBox(strPath)
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run strPath, 1, True
Set objShell = Nothing
MsgBox("done")

Thanks in advance

sb
 
If you look at the AIM shortcut, are there any arguments after "C:\Program Files\AIM6\aim6.exe"?

What happens when you run "C:\Program Files\AIM6\aim6.exe" from the command prompt?

What happens when you try "C:\Program Files\AIM6\aim6.exe /?" from the command prompt?

 
Are you getting an error?
try using strPath = "C:\Progra~1\AIM6\aim6.exe
 
This should get you going.

the Chr(34) puts the " around the path on the command line when the objShell.Run is executed.

Code:
Dim objShell, strPath
strPath = "C:\Program Files\AIM6\aim6.exe"
MsgBox(strPath)
Set objShell = WScript.CreateObject("WScript.Shell")
objShell.Run Chr(34) & strPath & Chr(34), 1, True
Set objShell = Nothing
MsgBox("done")

Hope this helps.


Thanks

John Fuhrman
Titan Global Services
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top