Welcome to WebmasterWorld Guest from 188.8.131.52 , register , free tools , login , search , subscribe , help , library , announcements , recent posts , open posts Subscribe to WebmasterWorld
vbscript to launch exe file on network drive or launch a local shortcut Purple Martin msg:944159 1:27 am on Nov 12, 2004 (gmt 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?
duckhunter msg:944160 5:30 am on Nov 12, 2004 (gmt 0)
Have you tried the UNC path with a shared folder in place? \\ServerNameOrIP\ShareName\Setup.exe Purple Martin msg:944161 12:05 am on Nov 15, 2004 (gmt 0)
Yes, however the cmd window can't switch drives to a network. duckhunter msg:944162 3:51 am on Nov 15, 2004 (gmt 0)
Try creating a batch file (Setup.bat) and place the UNC call in it. Then run the cmd /c path to batch file
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 msg:944163 9:51 pm on Nov 15, 2004 (gmt 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 msg:944164 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.