On Error Resume Next Dim objNetwork, strDrive, objShell, objUNC Dim strRemotePath, strDriveLetter, strNewName strDriveLetter = "X:" strRemotePath = "\\server\documents" strNewName = "Общий диск" mapped = false Set objNetwork = CreateObject("WScript.Network") Set oDrives=objNetwork.EnumNetworkDrives For i = 0 to oDrives.Count - 1 Step 2 If oDrives.Item(i)=strDriveLetter Then mapped = true Next If mapped Then objNetwork.RemoveNetworkDrive strDriveLetter If mapped Then objNetwork.MapNetworkDrive strDriveLetter, strRemotePath If Not mapped Then objNetwork.MapNetworkDrive strDriveLetter, strRemotePath Set objShell = CreateObject("Shell.Application") objShell.NameSpace(strDriveLetter).Self.Name = strNewName WScript.Quit