Geoff Chappell - Software Analyst
The Windows Shell presents disk drives in the My Computer folder (called just Computer in Windows Vista). These are seen most readily in the Windows Explorer when browsing the My Computer folder, but also show in many dialog boxes. Indeed, they show in any shell view of any instance of the My Computer object. As with all objects in the shell namespace, disk drives get display names which are meant to ease the user’s recognition of what might otherwise be obscure. Though programmers and so-called advanced users may be happy to think of disk drives in terms of drive letters, even they mostly prefer to give each drive a name, called a label. The shell’s display name is primarily this label, but drive letters are accommodated, along with a reminder of the type of drive (especially for drives that take removable media).
The style of display name has long been configurable, but as so often, Microsoft has not exactly rushed to say so. Windows Vista provides seven templates, and selects from them according to the current options and the nature of the drive or of its current contents.
Template for Display Name | Type of Drive | Options |
---|---|---|
type - label | optical drive containing labelled disk | always show type of optical drive; and do not show drive letters |
type - Unlabeled Volume number | unlabelled fixed disk other than drive C |
distinguish unlabelled fixed disks; and do not show drive letters |
label_else_type | do not show drive letters | |
(letter:) type - label | optical drive containing labelled disk |
always show type of optical drive; and show drive letters first |
type (letter:) label | optical drive containing labelled disk |
always show type of optical drive |
(letter:) label_else_type | show drive letters first | |
label_else_type (letter:) |
where label_else_type stands for the label of the media in the drive, if available, but falling back to the type of drive. For network drives, the label is typically a compound of the computer name and share name, with yet more parentheses.
Note the special concern to distinguish types of optical drive even while loaded, so that both the label and type are shown (if they differ). For the purpose of composing the display name for an optical drive, the SHELL32 from Windows Vista can identify the type as any of
Machines with more than one optical drive are not uncommon, and the option to distinguish them by showing both the type and label is on by default. Indeed, many users will not be able to choose differently, even if they knew the necessary setting, since it is one of policy not preference.
What is configurable by users in general is:
The choice is set through the following registry value in either of two keys, listed below in order of decreasing precedence. This order has the implication that administrators may specify a machine-wide default which users may override as they choose.
Keys | HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Explorer |
Value | ShowDriveLettersFirst |
Type | dword |
Default | 0 |
Availability | SHELL32, in late builds of version 4.72, and higher |
The data type may be REG_DWORD, but four bytes of REG_BINARY data is accepted also. The data is interpreted in bit flags:
0x01 | show drive letters first for remote drives |
0x02 | do not show drive letters |
0x04 | show drive letters first |
When the 0x02 bit is set, the others are ignored. When the 0x04 bit is set, the 0x01 bit is superfluous. In effect, there is no point to setting more than one bit.
In the original implementation, ShowDriveLettersFirst is recognised only in the HKEY_LOCAL_MACHINE branch, and the choice of settings is between 0x01 and anything else. All three settings are supported from version 5.00 onwards, i.e., for Windows 2000 and higher. Until a recoding for Windows Vista, the settings are mutually exclusive (i.e., they are compared as integer values, rather than tested as bit flags). This recoding for Windows Vista is also when HKEY_CURRENT_USER becomes supported.
No user-interface support is known until Windows Vista. None really is expected, not for general users anyway, since these versions support the setting only in a machine-wide key which general users are typically permitted only to read.
In Windows Vista, the 0x02 bit has user-interface support as “Show drive letters” among the “Advanced settings” on the View tab of the Folder Options. Note that the bit flag is for the opposite of the text: clearing the checkbox sets the 0x02 bit.
The other bits have no known user-interface support. They are mentioned in a Microsoft Knowledge Base article that is ostensibly about a different matter, namely The computer description appears before the computer name in Windows XP. No hint is given that this registry value is supported from as far back as Internet Explorer 4.01 SP2 and Windows 98 SE.
Windows Vista adds significantly to the configurability of display names for disk drives. New settings are defined such that the old styles, which are now within the control of general users, are also subject to administrative policy. With these new settings come two new styles, for special cases that were previously capable of ambiguity and may benefit from elaboration. The scheme looks to have been developed with an eye for generalisation, but also looks like it may be still in development. Perhaps this is why none of it is (yet) documented.
The relevant policies are specified in five registry values, which may each be in either of two keys. The five values allow that different policies can be set for the display names of different types of drive. Again, the keys are listed in decreasing order of precedence. This order has the implication that administrators may specify a machine-wide policy which binds all users (even administrators, except by changing the machine-wide policy).
Keys | HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer |
Values | DisplayName_Floppy DisplayName_FixedDisk DisplayName_OpticalDisk DisplayName_RemoteDrive DisplayName_RemovableDisk |
Type | dword |
Default | 0 |
Availability | SHELL32, in Windows Vista builds of version 6.00 |
The data type may be REG_DWORD, but four bytes of REG_BINARY data is accepted also. The data is interpreted in bit flags:
0x01 | show drive letters |
0x02 | show drive letters first |
0x04 | do not show both type and label for optical drives |
0x10 | do not distinguish unlabelled fixed disks |