According to : http://www.experts-exchang
Try adding a "\" to the drive letter...
strDriveLetter = "H:\"
:^ )
Main Topics
Browse All TopicsWindows 2003 Terminal Server - Using Group Policies to run a simple VB script to map drives based on Active Directory Group Security.
Some drive labels appear as <share> on <servername> (M:) <-This is correct
Some drive labels appear as Network Drive (O:) <- This is incorrect
I do not wish to use the vb commands to rename if possible as i have two different shares using the same drive letter but based on two different security groups.
Any ideas what is causing this, i have searched hard and can see no reponses from questions asking this. This only happens when using vb scripts (net use is not possible due to various drives being mapped dependant on your group membership
Also just to point out, when viewing this drive within applications the correct name appears, its only on My Computer or Explorer that this happens.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
According to : http://www.experts-exchang
Try adding a "\" to the drive letter...
strDriveLetter = "H:\"
:^ )
Hi - Here is part of the code, most of it is replicated with changing of paths and groups:
WshNetwork.RemoveNetworkDr
WshNetwork.RemoveNetworkDr
''' What Group Is The User A Member Of?
''' Make Sure we start at the beginning of the string
If InStr(1, strGroups, CH_GENEVAAPT) Then
wshNetwork.MapNetworkDrive
wshNetwork.MapNetworkDrive
End if
The N: drive is always shown correctly throughout the script, its only the O: drive mapping that does this... FYI a \ after the drive letter does not work in this script.
And the first part of the script if it helps...
''' Ignore Errors
On Error Resume Next
Dim objADSysInfo
Dim objCurrentUser
Dim strGroups
Dim wshNetwork
''' Ensure All Constants are in lowercase
Const CH_GENEVAAPT = "cn=ch genevaapt"
Const CH_ZURICHAPT = "cn=ch zurichapt"
Const CH_KLOTENHQ = "cn=ch klotenhq"
Const CH_ALLSTATIONS = "cn=ch allstations"
Const AT_ELINDT = "cn=at elindt"
Const AT_GRAZAPT = "cn=at grazapt"
Const AT_INNSBRUCKDT = "cn=at innsbruckdt"
Const AT_KLAGENFURTAPT = "cn=at klagenfurtapt"
Const AT_LEASEPLANDT = "cn=at leaseplandt"
Const AT_LINZDT = "cn=at linzdt"
Const AT_SALZBURGAPT = "cn=at salzburgapt"
Const AT_WEIZDT = "cn=at weizdt"
Const AT_WELSDT = "cn=at welsdt"
Const AT_WIENAPT = "cn=at wienapt"
Const AT_WIENDT = "cn=at wiendt"
Const AT_VIENNAAPT = "cn=at viennaapt"
Const AT_VIENNADT = "cn=at viennadt"
Const AT_ALLSTATIONS = "cn=at allstations"
''' Define Objects
Set objADSysInfo = CreateObject("ADSystemInfo
Set objCurrentUser = GetObject("LDAP://" & objADSysInfo.UserName)
Set wshNetwork = CreateObject("WScript.Netw
''' Build a string of group user is member of
If Not IsArray(objCurrentUser.Mem
strGroups = lcase(objCurrentUser.Membe
Else
strGroups = LCase(Join(objCurrentUser.
End If
yes, i have tried shorter shared names, around 5 characters (below the other share) and different drive letter mappings in case of registry confusion. Could this be a speed issue with the script, I.E why would N map fine and not O? is the script too long, are there rules for VB scripts mapping drives?
Business Accounts
Answer for Membership
by: VBRocksPosted on 2007-03-07 at 08:00:06ID: 18671091
Does your code look like the following?
ipt.Networ k")
dim wsh
set wsh = WScript.CreateObject("WScr
wsh.MapNetworkDrive "z:", "\\server\share"
set wsh = nothing
'Scripting file should be saved with a .vbs extention.