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

Wsh.AppActivate "anythin' but notepad" 1

Status
Not open for further replies.

enoc6

Technical User
Jun 18, 2002
7
US
I'm having problems using WSH with applications that are not located in the C:\Windows Directory; they are in my Program Files folder. I get an error message anytime I try to run any application that is not located in C:\Windows. I suspected modifying the path in the autoexec.bat file might help but I don't want to have to do that for every single program i want to automate.

Example
set WshShell = CreateObject("WScript.Shell")
WshShell.Run "notepad.exe"
WScript.Sleep 1000
WshShell.AppActivate "notepad"

This works great but if I try to use this script to open Procomm or PGP 7.0 then I have problems. Any pointers?!

OS: windows 98 SE.
 
You simply have to provide the full path. i.e.

WshShell.Run """c:\Program Files\Procomm\Procomm.exe"""

Use the """ if you've got a space in your absolute path.

Dave
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top