'Map Network Drive
' By UIOPUIOP 9/3/2008
On Error Resume Next
' Please modify below parameter
strCompName = "hostname.dnsname"
strShareName = "C$"
strUserName = "Administrator"
strPassword = "p@ssword"
strDriveLetter = "S:"
strNetworkDrive_LabelName = "Share_Drive"
' map the network drive
Set objNetwork = CreateObject("WScript.Network")
'object.MapNetworkDrive(strLocalName, strRemoteName, [bUpdateProfile], [strUser], [strPassword])
objNetwork.MapNetworkDrive strDriveLetter,"\\" & strCompName & "\" & strShareName,,strUserName,strPassword
' actually (re)names the Mapped Drive
Set objShell = CreateObject("Shell.Application")
objShell.NameSpace(strDriveLetter).Self.Name = strNetworkDrive_LabelName