Welcome to WebmasterWorld Guest from 54.204.220.238

Forum Moderators: ocean10000

Message Too Old, No Replies

vbscript to launch exe file on network drive

or launch a local shortcut

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 21, 2002
posts:977
votes: 0


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?

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

Preferred Member

10+ Year Member

joined:Oct 28, 2002
posts:506
votes: 0


Have you tried the UNC path with a shared folder in place? \\ServerNameOrIP\ShareName\Setup.exe
12:05 am on Nov 15, 2004 (gmt 0)

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 21, 2002
posts:977
votes: 0


Yes, however the cmd window can't switch drives to a network.
3:51 am on Nov 15, 2004 (gmt 0)

Preferred Member

10+ Year Member

joined:Oct 28, 2002
posts:506
votes: 0


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]

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

Senior Member

WebmasterWorld Senior Member 10+ Year Member

joined:Jan 21, 2002
posts:977
votes: 0


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)

Inactive Member
Account Expired

 
 


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.