Tips & Tricks, Tutorials, Hacking, Troubleshooting,

You may have drives showing in My Computer or Windows Explorer that you don’t use a lot, such as a USB flash drive or a network drive only used for backups, or a floppy drive. You can hide these drives in Windows 7 and Windows XP with a fairly simple change to the registry.

Drives showing in My Computer

NOTE: We recommend that you backup the registry before making changes to it. Refer to the following posts for help in backing up the registry.

Hiding drives using this method only hides the drive from view. Applications and the command prompt will still be able to access it and you can manually access it by typing a path to a folder on the drive in My Computer or Windows Explorer.

To hide one or more drives, open the Start menu and enter “regedit” (without the quotes) in the Search programs and files box. Press Enter when regedit.exe is listed in the results to open the Registry Editor. You may also click on the regedit.exe link.

Searching for regedit

NOTE: If you are using Windows XP, select Run from the Start menu to open the Run dialog box. Enter “regedit” (again, without the quotes) in the Open edit box and click OK.

Entering regedit in the Run dialog box in Windows XP

If the User Account Control dialog box displays, click Yes to continue.

NOTE: You may not see this dialog box, depending on your User Account Control settings. See our post, Windows 7 – How to configure UAC (User Account Control), for more information.

User Account Control dialog box

The Registry Editor displays. Navigate to the following key in the tree in the left pane.

HKEY_CURRENT_USER \ Software \ Microsoft \ Windows \ CurrentVersion \ Policies \ Explorer

You need to create a new value, called NoDrives, under the Explorer key that most likely does not exist. To do this, select the Explorer key and right-click in the right pane. Select New | DWORD (32-bit) Value from the popup menu. Name the new value NoDrives.

Creating a new DWORD value

Before assigning a value to the new DWORD value you created, you have to calculate what that value will be. The NoDrives value is a 32-bit number, with the bits arranged in reverse order for the letters that represent drives, a value of 1 for a letter hiding that drive. For example, we decided to hide the floppy drive, which is drive A: and a USB flash drive, that is drive E:. The bits for hiding these two drives would be arranged like the following table.

Z Y X W V U T S R Q P O N M L K J I H G F E D C B A
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 1

You would then convert the binary number 10001 (the bits between A and E in the table) to a decimal number. You can use the Calculator in Windows 7 or Windows XP to do this.

If you are using Windows 7, open the Calculator and select Programmer from the View menu.

Changing to the Programmer view in the calculator in Windows 7

On the right side of the Calculator, select the Bin radio button to turn on Binary mode.

Selecting Binary mode on the calculator in Windows 7

Enter “10001” (without the quotes) and then select the Dec radio button.

Entering a binary number in the calculator in Windows 7

The decimal value of 17 displays as the result. This is the value you will enter for the NoDrives value.

Decimal number calculated in Windows 7

Before we get back to defining the NoDrives value in the registry, we will show you how to convert the binary value “10001” to a decimal value in the Calculator in Windows XP. It’s a little different.

Open the Calculator and select Scientific from the View menu.

Changing to the Scientific view in the calculator in Windows XP

At top, left of the Calculator, under the entry box, select the Bin radio button to turn on Binary mode.

Selecting Binary mode on the calculator in Windows XP

Enter “10001” (without the quotes) and then select the Dec radio button.

Entering a binary number in the calculator in Windows XP

The decimal value of 17 displays as the result. Again, this is the value you will enter for the NoDrives value.

Decimal number calculated in Windows XP

To enter the value for NoDrives, double-click on the NoDrives value in the right pane in the Registry Editor.

Double-clicking the NoDrives value

The Edit DWORD (32-bit) Value dialog box displays. First, select the Decimal radio button in the Base box. Then, enter “17” in the Value data edit box. Click OK.

NOTE: If you are hiding different drives and have calculated a different value for NoDrives, enter that value in the Value data edit box.

Entering the decimal Value data

The value you entered displays in the Data column, along with the hexadecimal value, which, in our case, is 0×11.

Data value set

To close the Registry Editor, select Exit from the File menu.

Closing the Registry Editor

To put these changes into effect, you need to restart explorer.exe. We have previously written about the safe way to do this in Windows 7, Vista, and XP. See our post, Restart the Explorer.exe Process Correctly in Windows.

A and E drives hidden

If you want to hide one drive, the following chart is a quick reference, showing you the Decimal and Hexadecimal values for commonly used drive letters.

Drive Letter Decimal Hex
A 1 1
B 2 2
C 4 4
D 8 8
E 16 10
F 32 20
G 64 40
H 128 80

To hide multiple drives, use the table of all the drive letters shown earlier in this post to figure out the correct binary code, and then convert that to decimal or hexadecimal using the calculator methods also discussed earlier.

To show the drives again, simply open the Registry Editor again and delete the NoDrives value you added.

No comments:

Post a Comment