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!

VBScript - Run from variable network path

Status
Not open for further replies.

Poore1

MIS
Jun 5, 2003
2
US
I'm trying to modify part of a script so that it can run from any of our DP's. Here is the current code section:

Dim objShell
Set objShell = WScript.CreateObject( "WScript.Shell" )
objShell.Run("""\\SERVER\SHARE\FOLDER\FOLDER2\FOLDER3\INSTALL_ME.exe""")
Set objShell = Nothing

This works but I don't want it to run only from this location but from what ever DP it is being executed from. The only part of the path that would change would be the SERVER name. The SHARE and FOLDER paths would be constant. Is there a wildcard or another method I can use for the SERVER name?

I've been researching using something like app.path but haven't been successful finding a solution.

Thanks for helping!
 
You may try this:
objShell.Run "cmd /C ""%LOGONSERVER%\SHARE\FOLDER\FOLDER2\FOLDER3\INSTALL_ME.exe"""

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
No error but nothing happens. I see the CMD window flash but the program doesn't execute.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top