2

How might one control the label for mapped drives as they appear in My Computer, from the command line?

The goal is to have the drive letter at the beginning of the phrase instead of the end, so when navigating with the keyboard one simply types the drive letter to jump to that item in the list. So, for example:

net use x: \\servername\skunkworks

will show this in My Computer:

skunkworks on 'Long descriptive name of file server (servername)' (X:)

but what we want is something like:

X: Skunkworks on Servername

One can interactively change the label with Windows Explorer, but this must be done seperately for every user profile and is a pain. It'd be really nice to relabel the drives as part of the login script.

2 Answers 2

2

You can actually change this per drive mapping with a name of your choice. We do this if customers want to give more friendly names to mapped drives in enterprise environents.

Check out the following vbscript to get you in the right direction (a better script would take path an desired name as arguments and do drive mappings in a function for a bit more streamlined and object-oriented approach)

http://www.computerperformance.co.uk/ezine/ezine60.htm

1

From The computer description appears before the computer name in Windows XP:

Warning Serious problems might occur if you modify the registry incorrectly by using Registry Editor or by using another method. These problems might require that you reinstall your operating system. Microsoft cannot guarantee that these problems can be solved. Modify the registry at your own risk.

  1. Click Start, click Run, type regedit, and then click OK.
    1. Locate and then click one of the following subkeys in the registry: HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\Explorer HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\policies\Explorer
    2. On the Edit menu, point to New, and then click DWORD Value.
    3. Type ToggleCommentPosition, and then press ENTER.
    4. On the Edit menu, click Modify.
    5. Type 1, and then click OK.
    6. On the Edit menu, point to New, and then click DWORD Value.
    7. Type ShowDriveLettersFirst, and then press ENTER.
    8. On the Edit menu, click Modify.
  2. Type 2, and then click OK.

The registry values have the following results:

Key: ToggleCommentPosition Type: DWORD Value: 1 or 0 If the value is 0, Windows uses "share_name on comment_text (computer_name) (drive_letter)."

If the value is 1, Windows uses "share_name on computer_name (comment_text) (drive_letter)." Key: ShowDriveLettersFirst Type: DWORD Value: 1,2, or 4 If the value is 1, the drive letter is displayed first for remote drives. If the value is 2, drive letters are not displayed. If the value is 4, the drive letter is displayed first for all drives. This registry entry can be applied in a Per-Machine policy or in a Per-User policy, by using one of the following subkeys:

* For a Per-Machine policy, click the following registry subkey:
  HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\policies\Explorer
* For a Per-User policy, click the following registry subkey:
  HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\policies\Explorer

How to Modify the Windows Registry

1
  • thanks, this almost works. The drive letter does indeed show first, but it doesn't help with keyboard navigation is it's within parens (). I've also learned TweakUI can set this without having to invoke regedit (though that's still not automated for a workgroup). Commented Aug 23, 2009 at 16:31

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .