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

map network drive with password

Status
Not open for further replies.

hsingh1981

Programmer
Apr 8, 2008
56
GB
Hi all i have this code which i got from this website was really helpful. How do i tweak it so that if the drive requests for username and password?

Code:
Set WshNetwork = CreateObject("WScript.Network")

On Error Resume Next
WshNetwork.RemoveNetworkDrive "L:", True
On Error GoTo 0

WshNetwork.MapNetworkDrive "L:", "\\gstq1\cvutils" 'HardDrive"

Set WshNetwork = Nothing

many thanks
 
WshNetwork.MapNetworkDrive "L:", "\\gstq1\cvutils", False, strUser, strPassword

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top