Welcome to WebmasterWorld Guest from 54.167.58.159

Forum Moderators: ocean10000

Message Too Old, No Replies

vbscript to launch exe file on network drive

or launch a local shortcut

     

Purple Martin

1:27 am on Nov 12, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I'm writing an intranet-only browser based application. I need to launch either a SETUP.EXE that is on a network drive or a shortcut on a local drive that points to the exe on the network drive.

I already know how to launch a local exe, for example:
Set objApp = CreateObject("WScript.Shell")
objApp.Run "cmd /C CD C:\ & Program Files & SomeFolder & SETUP"

How can I launch a network exe?

duckhunter

5:30 am on Nov 12, 2004 (gmt 0)

10+ Year Member



Have you tried the UNC path with a shared folder in place? \\ServerNameOrIP\ShareName\Setup.exe

Purple Martin

12:05 am on Nov 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, however the cmd window can't switch drives to a network.

duckhunter

3:51 am on Nov 15, 2004 (gmt 0)

10+ Year Member



Try creating a batch file (Setup.bat) and place the UNC call in it. Then run the cmd /c path to batch file

[edit]doh! this is client side. that won't work! Do your intranet users have a network drive that's always mapped when logged in, like a public drive where the batch file could live? Or make a call to map a network drive before calling the cmd[/edit]

Purple Martin

9:51 pm on Nov 15, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks for the suggestions.
Do your intranet users have a network drive that's always mapped when logged in, like a public drive where the batch file could live?

Yes, but I don't quite understand how this would help. I'm having trouble launching a network .exe, so how would a network .bat be any easier?

jamesnylen

11:45 pm on Nov 15, 2004 (gmt 0)



objApp.Run "cmd /C net use z: \\comp\path\ [password] & z: & setup"

The "net use" command is what you are looking for.

Type "net use /?" in CMD for more help.