Having a data protection plan is key to ensuring that your organization’s sensitive and important information is always kept safe. And for a lot of organizations, especially ones that use portable USB drives, this can involve making their disks write-protected.
There are a couple of ways to enable this feature. In this article, we’ll discuss how to enable or disable write protection using Command Line and Registry Editor.
What is write protection?
Generally speaking, a computer inputs and edits information on a disk drive as you’re using it. However, if you enable write protection on a disk drive, this will prevent data from being written or altered on the drive. This means that you can no longer add, modify, or delete files from the disk until write protection is disabled again.
Requirements
Before you get started, ensure you have everything you require to complete the task. For this guide, you’re going to need the following:
- A Windows 10 computer and an account that has administrator access.
- A removable or fixed disk with an accessible volume.
- Optional but not required: familiarity with Command Line or Windows Registry.
Method 1: Enable or disable write protection via DiskPart (Command Line)
The first way to enable write protection is by using DiskPart. This has to be done through Command Line, so make sure you have the necessary administrator permissions before proceeding.
- Open the Start Menu.
- Search for Command Prompt, and open the program.
- Type diskpart > Enter.
- Input list disk to see all disk drives currently connected to your computer.
- Select your target disk (example: Disk F) and type select disk f > Enter.
- Type attributes disk set readonly > Enter.
- That disk will now be write-protected. You can now close Command Prompt.
Method 2: Enable or disable write protection via Registry Editor
The Registry Editor is another tool you can use to enable write protection. However, do keep in mind that this method can only be used on USB disk drives. And, since the Windows Registry contains advanced computer controls and configurations, make sure you have a backup before starting.
- Open the Start Menu.
- Search for Registry Editor and open it.
- Input this into the address bar:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies - Right-click the StorageDevicePolicies key > New > DWORD (32-bit) Value.
- Name the new file WriteProtect.
- Double-click the Write Protect File and set the value to 1 to enable write protection. To disable it, set it to 0 instead.
- Click OK.
- Restart your computer. Changes should apply once the system boots back up.
If you can’t find StorageDevicePolicies, you have to create it before proceeding with the next steps. Here’s how to do so:
- Navigate to this address:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control - Right-click the Control key > New > Key.
- Name the new key StorageDevicePolicies.
Notes and use cases
Each method has slightly different effects, and there are pros and cons to using one over the other, depending on your specific situation. Here are some notes on the methods provided in this guide:
- If you use the Command Line method, the effects will be immediate and affect the whole drive.
- The Windows Registry method can only be used for USB removable devices.
- Some devices, commonly in SD cards, have hardware-based write protection switches. If the device you’re working on does have that, it cannot be overridden by software commands. You have to override the hardware switch manually.
Why use it?
If the disk drive contains important data, write protection will prevent the accidental deletion and modification of any data on it. This enhances your organization’s security by locking the content of portable drives and protecting their integrity even while they’re out of the office premises.
The feature is also especially useful for forensic, archival, and public-access information. This way, people who don’t have the necessary access and permissions will be able to view the data contained within the drive, but they won’t be able to make changes to it.
Who might use a write-protected disk?
IT professionals, system administrators, digital forensic experts, and anyone interested in cybersecurity. Write protection is an important tool in overall endpoint security management, so it’s something all organization IT departments should consider mastering.
Troubleshooting options for making disks write-protected
When working with Command Line or the Windows Registry, things might not always go the way you expect them to. Here are some common issues that come up when configuring write protection and how you can solve them:
DiskPart returns “Disk is not editable”
Make sure that the disk is not in use and that no partitions are mounted.
The registry key is missing
If the registry key is missing, you’ll have to complete it manually. Follow this step-by-step guide to do that.
Still can’t write after disabling write protection
Try checking for a physical write-protect switch. Software won’t be able to override that, so you’ll have to turn it off manually.
Frequently Asked Questions: Enabling write-protected disk
Does this work for all USB flash drives?
Yes. This guide should work as long as the drive doesn’t have a physical write-protect switch.
Will enabling write protection via DiskPart make the drive read-only on all PCs?
Not necessarily. The drive will be read-only on Windows machines that respect the read-only flag. However, some operating systems may not honor or be able to read the read-only flag.
Can I still format a write-protected drive?
No. Write protection will prevent any files from being deleted from the drive. If you try to format it while it’s still read-only, the formatting will fail.
Final thoughts on how to change write protection on USB drives and fixed storage disks
Write protection is an incredibly useful and practical feature that secures and protects data on both removable and fixed storage media. With useful computer tools, such as DiskPart and the Windows Registry, you can quickly enable or disable write protection as needed.
Every organization has unique needs and circumstances, and it’s important to take those into account when deciding how to implement write protection for your disk drives. Some devices already have write protection built into their hardware, so make sure to verify that before trying out software options.
DiskPart is a great option if you’re looking for broader controls. And if you’re working with USB drives, the Windows Registry might be your best choice. Whatever choice you make, just ensure it’s the one that will work best to accomplish your goals.