Renaming the Description of a Mapped Network Drive

G

Guest

I'm sure this question has been asked before, but I cannot seem to find an
answer. Is there a way to shorten the description of a mapped network drive
in Windows XP. Windows 2000 seems to use
<sharename> on '<servername> (X:)',
but Windows XP uses
<sharename> on '<computer description> (servername) (X:)',
which causes the drive letter to not be visible in the Look In dropdown in
standard Windows and Office open dialogs.

I guess the obvious answer is to remove all computer descriptions from
servers that are hosting mapped network drives, but I'm curious if (1)
there's a way within a logon script to shorten the share description, or (2)
there's a way to configure Windows XP to not show the computer description.
 
D

DanS

I'm sure this question has been asked before, but I cannot seem to
find an answer. Is there a way to shorten the description of a mapped
network drive in Windows XP. Windows 2000 seems to use
<sharename> on '<servername> (X:)',
but Windows XP uses
<sharename> on '<computer description> (servername) (X:)',
which causes the drive letter to not be visible in the Look In
dropdown in standard Windows and Office open dialogs.

I guess the obvious answer is to remove all computer descriptions from
servers that are hosting mapped network drives, but I'm curious if (1)
there's a way within a logon script to shorten the share description,
or (2) there's a way to configure Windows XP to not show the computer
description.

Actually, a more obvious answer is to right-click the Network Drive and
pick 'Rename'.
 
G

Guest

Good point. However, the network drives are mapped by the logon script each
time the user logs on, so any renaming they have done is lost at the next
logon.
 
M

Mak

If all you want is to show drive letter (I don't know of a way to
drop/shorten computer description) in the Look In and such,
you can try this:
In regedit: HKLM\Software\Microsoft\Windows\CurrentVersion\Explorer
create DWORD value "ShowDriveLettersFirst" (with no quotes) and set it to
the desired value:
0 = Default display (drive letters after description)
1 = Network drive letters first, Local drive letters after
2 = Descriptions only, no drive letters displayed
4 = Local and Network Drive letters before description
 
T

Torgeir Bakken \(MVP\)

Hi,

Adjusting the description in a logon script is possible, below is
a VBScript example (.vbs) you can try.


'--------------------8<----------------------

Call AdjustDriveDescription()


Sub AdjustDriveDescription

On Error Resume Next
Dim oShellApp, oWshNet, oDrives, i, sDrive, sDriveDesc
Dim sUNCPath, aUNCPath, sNewDriveDesc, sLastElement

Set oShellApp = CreateObject("Shell.Application")
Set oWshNet = CreateObject("WScript.Network")
Set oDrives = oWshNet.EnumNetworkDrives

For i = 0 to oDrives.Count - 1 Step 2

sDrive = oDrives.Item(i) & "\"
sDriveDesc = oShellApp.NameSpace(sDrive).Self.Name

' remove the \\ in front
sUNCPath = LCase(Mid(oDrives.Item(i+1), 3))
aUNCPath = Split(sUNCPath, "\")

If UBound(aUNCPath) > 0 Then
sLastElement = aUNCPath(UBound(aUNCPath))
sNewDriveDesc = sLastElement & " on '" _
& Left(sUNCPath, Len(sUNCPath) - Len(sLastElement) - 1) & "'"

oShellApp.NameSpace(sDrive).Self.Name = sNewDriveDesc

End If
Next
On Error Goto 0
End Sub

'--------------------8<----------------------
 
D

DanS

Good point. However, the network drives are mapped by the logon
script each time the user logs on, so any renaming they have done is
lost at the next logon.

DOH ! Well that little piece of info changes everything ! Read on to Mak's
solution.

Sorry !
 
G

Guest

Thanks for this detailed script. I'm trying to write a utility to allow
users to selectively map network drives and some of the code herein will
hopefully help. (After I figure out how it works!!)

Thanks,
Mike
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top