Pages

Tuesday, 21 January 2014

How to hide drive for specific users in Windows 7?

If you’ve got drives in My Computer that you never access, such as a USB Flash drive that you are using solely for ReadyBoost, a floppy drive, or a network drive only used for a particular piece of software, then you might want to simply hide the drive from your computer.
This tip will only hide the drive from being displayed, applications and the command prompt will still have access to it, and you can still manually browse to the folder if you type in the path.
Now what’s that floppy drive doing there?
image
Configure the Hidden Drives
Open up regedit.exe by using the start menu search box, and then browse down to the following key.
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
If the Explorer key does not exist, you can right-click on Policies, select New Key and name it Explorer.
The NoDrives key most likely does not exist by default, so you’ll need to create it with right-click \ new 32-bit DWORD and name it NoDrives.
This value is a 32 bit number, and the bits are arranged in reverse order with a value of 1 hiding that drive. For example, if we wanted to hide drives A: and F: we would arrange it like this:
ZYXWVUTSRQPONMLKJIHGFEDCBA
00000000000000000000100001
Converting 100001 to decimal we end up with a decimal value of 33 or a hex value of 0×21, so if you double-click on the key in the registry editor, choose Decimal and then enter 33 into the value field.
In order to see these changes, you’ll need to restart explorer.exe, which you can do easily from Task Manager or the longer way by just logging off and back on.
Uninstall Tweak
To disable this tweak, simply remove the NoDrives registry key entirely.

OR


If you want to disable a drive other than A, B, C, or D, or if you have a version of Windows 7 which doesn't support the group policy editor, you will need to make the changes manually in the registry.
The first step is to load the registry hive of the user you are removing the drives from. The user must be logged out for this to work; in fact, it's better to do a fresh restart before doing this process.
  1. Open the registry editor with administrative privileges
  2. Select HKEY_USERS
  3. Choose Load Hive from the File menu
  4. Navigate to that user's profile folder, usually C:\users\username
  5. Enter NTUSER.DAT in the File name box. This file is a system-hidden file, so it won't show up in the file selection window. You have to type it in. Be sure not to select ntuser.dat.log by accident.
  6. Click ok, then enter a name for the key. We'll call it Foo.
  7. Go toHKEY_USERS\Foo\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
  8. Create a new 32-bit DWORD value and name it NoDrives to hide the drives, or NoViewOnDrive to completely disable access.
  9. The value you enter depends on the drive(s) you want to restrict, and is a bit tricky. Each letter, starting with Z and going down to A, is represented by a 1 (disabled) or 0 (enabled). Make this binary number, then convert it to hexidecimal. This is the number you put in the box. For example, D is the fourth drive letter from the right, and everything to the left of it is a 0, so the number will beb1000, which is x08000000, so you would enter 08000000 as the value. To disable C and D, you would use b1100, or x0c000000. If this confused you, post in the comments for help.
  10. Once you've saved this value, navigate back up to HKEY_USERS, select the key you loaded, and then click File > Unload Hive. This step is ABSOLUTELY CRITICAL!! If you don't unload the hive, the user will be unable to login properly.
  11. Close the registry editor, then restart the computer. The new settings should have taken effect.

No comments:

Post a Comment