How to restrict access to a drive in windows?

This restriction prevents accessing the content of selected drives from My computer, explorer, Run, command prompt.

Open Registry Editor (START > RUN > Type REGEDIT and click OK)
Navigate to:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer

In the right-pane, right-click and create a new DWORD value "NoViewDrive" (case-sensitive).
Select value from the table below to hide corresponding drive.
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
Lock All Drive: 67108863
Unlock All Drive: 0

NOTE:
  • To lock multiple drives, add the values. i.e., to hide E & F = 48 (16+32)
  • To allow access, just delete "NoViewDrive" value.

Download "RestrictDrv.vbs", enter value in inputbox to apply restriction. [0 to allow access]

Post a Comment