Saturday, 28 May 2016

Windows registry trick #1: prevent access to certain drives

How to prevent access to select drives using Registry
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 follow the following steps:
Step 1) open registry editor by typing "regidit.exe" in run.
Step 2) Search for HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer in registry editor
Step 3) Now rightclick on the right pane and select “New»DWORD (32-bit) Value” and name it
"NoViewOnDrive"

Step 4) 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 button, paste this value.

In this picture I have selected D: drive and E:drive 8+16 = 24
Step 5) After this step, you just have to close registry editor. The settings take effect immediately. (Note: If this doesn’t take effect try restarting computer) Next time you try to access one of the drives you will encounter and error message as shown below :

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

No comments: