Home How to's

How to prevent access to select drives using Registry Editor


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 :


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 :

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.

Also Read:  How to Use Your Android’s Built-In Tethering While Your Carrier Blocks It