Как замена стандартному батнику, что не понимает длинные русские имена. Это когда шару переименовать нельзя. Да и вообще приятственно.
Вторая версия тут
Set WshNetwork = CreateObject("WScript.Network")
Set objShell = CreateObject("Shell.Application")
On Error Resume Next
strUser = WshNetwork.UserName
strDomain = "YOUR_DOMAIN_NAME.LOCAL"
Set colGroups = GetObject("WinNT://" & strDomain & "")
colGroups.Filter = Array("group")
For Each objGroup In colGroups
For Each objUser in objGroup.Members
If objUser.Name = strUser Then
Select Case objGroup.Name
Case "Пользователи домена"
wshNetwork.RemoveNetworkDrive "W:"
wshNetwork.MapNetworkDrive "W:", "\\server\servershare3"
objShell.NameSpace("W:").Self.Name = "Данные"
wshNetwork.RemoveNetworkDrive "Q:"
wshNetwork.MapNetworkDrive "Q:", "\\server\servershare2"
objShell.NameSpace("Q:").Self.Name = "Мультимедиа"
wshNetwork.RemoveNetworkDrive "Z:"
wshNetwork.MapNetworkDrive "Z:", "\\server\servershare1"
objShell.NameSpace("Z:").Self.Name = "Ололо"
wshNetwork.RemoveNetworkDrive "X:"
wshNetwork.MapNetworkDrive "X:", "\\server\servershare"
objShell.NameSpace("X:").Self.Name = "Бэкапы"
End Select
End If
Next
Next
или через gpp
Вторая версия тут
Set WshNetwork = CreateObject("WScript.Network")
Set objShell = CreateObject("Shell.Application")
On Error Resume Next
strUser = WshNetwork.UserName
strDomain = "YOUR_DOMAIN_NAME.LOCAL"
Set colGroups = GetObject("WinNT://" & strDomain & "")
colGroups.Filter = Array("group")
For Each objGroup In colGroups
For Each objUser in objGroup.Members
If objUser.Name = strUser Then
Select Case objGroup.Name
Case "Пользователи домена"
wshNetwork.RemoveNetworkDrive "W:"
wshNetwork.MapNetworkDrive "W:", "\\server\servershare3"
objShell.NameSpace("W:").Self.Name = "Данные"
wshNetwork.RemoveNetworkDrive "Q:"
wshNetwork.MapNetworkDrive "Q:", "\\server\servershare2"
objShell.NameSpace("Q:").Self.Name = "Мультимедиа"
wshNetwork.RemoveNetworkDrive "Z:"
wshNetwork.MapNetworkDrive "Z:", "\\server\servershare1"
objShell.NameSpace("Z:").Self.Name = "Ололо"
wshNetwork.RemoveNetworkDrive "X:"
wshNetwork.MapNetworkDrive "X:", "\\server\servershare"
objShell.NameSpace("X:").Self.Name = "Бэкапы"
End Select
End If
Next
Next
или через gpp
0 коммент.:
Отправить комментарий