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

Open UNC path \\ServerName\ShareName through vbscript

Status
Not open for further replies.

0LaoyanG0

MIS
Nov 12, 2002
25
US
This sounds simple enough right?
OK, here's what I want to do. I am logged in as the local Administrator and I want to open an explorer window using a UNC path. This would be just like if you went to Start|Run and typed in a UNC path to a share. If you did this logged on as local Admin, you would get prompted with credentials, type it in and away you go.
Now, through a script I want to basically do the same thing but when I do it nothing opens because local admin does not have "rights" to the resource/share and it doesn't even prompt for credentials. How can I do this all via a vbscript? Prompting for credentials is not an issue.
 
Via script you may connect a shared directory to a mapped drive giving the credentials.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Perhaps we're interpreting the question wrong. Did you want a script to open Explorer on the share?
Code:
Option Explicit
'See: Command-Line Switches for Windows Explorer
'located at [URL unfurl="true"]http://support.microsoft.com/kb/130510[/URL]

Const vbNormalFocus = 1
Const PathToOpen = "\\Blue\testshare"

WScript.CreateObject("WScript.Shell").Run _
  "explorer.exe /n,/root,""" & PathToOpen & """", vbNormalFocus
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top