How to prevent access to select drives using Registry

You may want to learn how to open, backup and edit registry which are explained in an easy to understand fashion in that page. There is another way using Disk Management to disable access to a drive. It is easier and much better than the method explained here. Yet another post explains how you can prevent others from copying data from your PC onto a USB storage device.

You can prevent access to any drive in Windows by creating a DWORD in registry. The advantage of this method is that, a single DWORD can disable access to drives selected by you. In order to try this, you have to open registry (try the introduction post to registry mentioned at the start) and browse to the KEY :

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

Now rightclick on the right pane and select “New»DWORD (32-bit) Value” and name it NoViewOnDrive

Registry, creating a DWORD  to prevent drive access.

Browse to the specified key and create a new DWORD by rightclicking

The corresponding HKEY_LOCAL_MACHINE key :
HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

would probably allow you to apply a system wide restriction. I haven’t tried it yet.

From the following list, find the values of the drives you want to prevent access to. Now add these values together. For example, if you want to prevent access to D drive(8) and J drive(512) you will have 8+512 = 520.

A – 1, B – 2, C – 4, D – 8, E – 16, F – 32, G – 64, H – 128, I – 256, J – 512, K – 1024, L – 2048, M – 4096, N – 8192, O – 16384, P – 32768, Q – 65536, R – 131072, S – 262144, T – 524288, U – 1048576, V – 2097152, W – 4194304, X – 8388608, Y – 16777216, Z – 33554432, ALL – 67108863

If you need to disable access to more than one drive you may add the values corresponding to all those drives and set the value. That is if you need to disable D and F drives add 8 (D)+32 (F) = 40 to the key. Double Click on the NoViewOnDrive DWORD and after selecting Decimal radio button, paste this value.

Regedit, modifying a DWORD value for Drive access

In this picture I have selected D: drive and E:drive 8+16 = 24

After this step, you just have to close registry editor. The settings take effect immediately. (If this doesn’t take effect try restarting windows explorer) Next time you try to access one of the drives you will encounter and error message as shown below :

Drive access error

Error when trying to access a drive that has been blocked using registry.

Some related articles you may like :

  1. How to disable access to Drives using Disk Management
  2. How to view all drives, Disk Management under Windows
  3. Prevent copying of files to USB drive
  4. Virus infection by autoplay, how to prevent it
  5. How to Disable Autoplay/Autorun
  6. First step to a cleaner and faster Windows – understand the Registry
  7. Change the default Drive Icons in Windows XP
  8. Clear the most recently run commands in Run Box from Registry

This entry was posted in Windows and tagged Registry, Tips, Trick. Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

3 Comments

  1. vineeth
    Posted January 23, 2012 at 5:19 PM | Permalink

    this method only block acess through explorer…..we can access using CMD..

  2. Posted September 30, 2009 at 9:06 AM | Permalink

    Hi Joseph, the answer to your comment has been posted as a new post here : http://www.exnol.com/disk-tools/how-to-disable-access-to-drives-using-disk-management

    Thank you very much for posting the question.

  3. joseph
    Posted September 15, 2009 at 1:12 PM | Permalink

    this method works but unfortunately some softwares (eg ashampoo)managed to access the blocked drives.
    if you have any further knowledge to block access to drives, kindly share them with me.

    thanx

One Trackback

  1. [...] If you want to prevent access to a drive, read 2nd tip in “Points to note” given after this post or read how to Prevent access to select drives using Registry. [...]

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>