How to Enable or Disable Write Access to Removable Disks using a REG file in Windows

Introduction
In today’s digital world, protecting sensitive data is more important than ever. One common security loophole is uncontrolled access to USB storage devices. If you want to restrict or enable write access to USB drives in Windows, a simple method is using a .reg
file to modify the Windows Registry.
This tutorial will guide you through enabling or disabling write access to removable disks using a .reg
file — a safe and efficient method used by IT professionals and advanced users alike.
🔧 What is a .REG File?
A .reg
file is a plain text file containing registry keys and values that can be imported into the Windows Registry. These files are used to tweak or automate system configurations without manually opening the Registry Editor.
🛡️ Why Enable or Disable Write Access?
- Prevent Data Theft: Disable write access so users can’t copy files from your computer.
- Avoid Malware: Prevent users from transferring malware via USB.
- Compliance: Maintain security policies in office or public computers.
📁 Registry Path Involved
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies
If this key doesn't exist, you'll need to create it manually.
✅ Enable USB Write Access using .REG File - (Can copy files to USB)
- Open Notepad.
- Paste the following code:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies]
"WriteProtect"=dword:00000000
- Save the file as
EnableUSBWrite.reg
. - Double-click the file and confirm when prompted.
❌ Disable USB Write Access using .REG File - (Can't copy files to USB)
- Open Notepad.
- Paste the following code:
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies]
"WriteProtect"=dword:00000001
- Save the file as
DisableUSBWrite.reg
. - Double-click the file and confirm the prompt.
🔄 Revert Changes
To revert the change at any time:
- Run the appropriate
.reg
file. - Restart your PC (sometimes required).
🔢 Difference Between 0 and 1 in .reg File (Very Easy Language)
In the registry file:
"WriteProtect"=dword:00000000
👉 This means: USB write is allowed
🟢 You can copy files to the pen drive (USB drive).
"WriteProtect"=dword:00000001
👉 This means: USB write is blocked
🔴 You cannot copy files to the pen drive. You can only read or view files.
✅ Summary Table
Value | Meaning | USB Action |
---|---|---|
0 | WriteProtect is OFF | ✅ Can copy files to USB |
1 | WriteProtect is ON | ❌ Cannot copy files to USB |
👉 Tip: Use 0
if you want to use USB normally. Use 1
if you want to lock USB from writing.
🧠 Tips and Precautions
- Always backup your registry before making changes.
- Use an Administrator account to apply registry modifications.
- Use Group Policy Editor for more advanced control (Windows Pro editions).
📌 Additional Method: Group Policy Editor (For Pro Users)
- Press
Win + R
, typegpedit.msc
, and press Enter. - Navigate to:
Computer Configuration > Administrative Templates > System > Removable Storage Access
- Look for:
"Removable Disks: Deny write access"
Set it to Enabled to deny write access.
This method works in Windows Pro and Enterprise editions only.
❓ FAQs
Q1: Will this method work on Windows 10 and 11?
Yes, this method works on Windows 7, 8, 10, and 11.
Q2: Can standard users run these .reg files?
No, registry changes require administrator privileges.
Q3: Does this block file reading too?
No, it only blocks writing. Users can still read files from USB drives.
Q4: Is it reversible?
Yes, just use the enable .reg
file to undo the changes.
✅ Conclusion
Disabling or enabling USB write access is a great way to control the data flow on your Windows PC. Whether you are an admin trying to protect sensitive data or a user trying to secure your personal system, using a .reg
file is a quick and reliable solution.
Always remember to backup your registry and use these tweaks responsibly. With just a few clicks, you can gain complete control over your system’s USB write permissions.