Можно так:
Dim oShell, objFSO, WshNetwork
Set oShell = CreateObject("Shell.Application")
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set WshNetwork = CreateObject("WScript.Network")
MapDrv "Z:", "\\server\share","Share description", "username", "password" 'Буква диска, путь с шаре, описание
Function MapDrv(DrvLet, UNCPath, DrvName, Uname, Upass)
If objFSO.DriveExists(DrvLet) Then
WshNetwork.RemoveNetworkDrive DrvLet, true, true
End If
Wscript.Sleep 1000
WshNetwork.MapNetworkDrive DrvLet, UNCPath, false, Uname, Upass
oShell.NameSpace(DrvLet).Self.Name = DrvName
End Function
UPD: Если ничего не напутал
Syntax
objNetwork.MapNetworkDrive(strLocalDrive, strRemoteShare, [persistent], [strUser], [strPassword])