If you want to prevent users from accessing the Drives in File Explorer, then the Local Group Policy Editor has a setting that allows admins from restricting access to the C drive or all the drives visible in the This PC section. You can also do this using the Registry Editor.
Although you can hide a drive, the user can access the drive if he/she comes across the drive, in some other way. This tutorial is handy since users cannot access a specific drive or all drives to save a file or make changes. When you enable this setting other users will not be able to save images, videos, documents, etc. However, all your installed programs will run without any error.
Prevent users from accessing Drives in Windows 11/10
To prevent users from accessing drives in Windows 11/10 Explorer:
- Press Win+R to open the Run prompt.
- Type gpedit.msc and hit the Enter button.
- Navigate to File Explorer in User Configuration.
- Double-click on Prevent access to drives from My Computer.
- Select Enabled.
- Select the drive letter from the drop-down list.
- Click Apply and OK to save.
Open the Local Group Policy Editor on your computer. For that, press Win+R, type
gpedit.msc and hit the Enter button.
Next, navigate to the following path-
User Configuration > Administrative Templates > Windows Components > File Explorer
Find the setting called Prevent access to drives from My Computer and double-click on it on your right-hand side. Select the Enabled option and expand the drop-down menu.
Here, it is possible to select the drive letter. You can choose:
- Restrict C drive only
- Restrict all drives
or any other option as per your requirement. At last, click the Apply and OK buttons to save the change.
Following that, whenever you try to open the selected drive, you will be greeted with an error message saying the restriction.
In case you want to allow everyone to access all the drives or lift the barrier, go to the same setting, and select Not Configured option.
Using Registry Editor
In case you want to do the same with Registry Editor, you need to open the Registry Editor and follow this path-file
Right-click on Explorer, select New > DWORD (32-bit) value and name it as NoViewOnDrive.
Next, double-click on it, set the value as 4 (to prevent C drive), or 3ffffff (to restrict all drives). Then, click OK to save the change.