sodcalculator

10 Tech How-To

How to Make a Disk Write Protected in Windows 11

Guide 10-49314 · Updated · Step by step

Making a disk write-protected in Windows 11 prevents any data from being added, modified, or deleted on that drive. This is useful for protecting important files from accidental changes, preventing malware from altering system files, or preparing a drive for archival storage. You can achieve this using built-in Windows tools—no third-party software required.

What You’ll Need

  • A Windows 11 PC with administrator access
  • The disk you want to protect (USB drive, SD card, internal partition, or external HDD/SSD)
  • Backup of any important data on that disk (the process may require formatting for some methods)

Step-by-Step

There are three main ways to make a disk write-protected in Windows 11. Choose the one that fits your situation. All require administrator rights.

Method 1: Using Diskpart (Command Line)

  1. Press Windows + X and select Terminal (Admin) or Command Prompt (Admin).
  2. Type diskpart and press Enter. If prompted by User Account Control, click Yes.
  3. Type list disk and press Enter. Note the disk number of the drive you want to protect (e.g., Disk 1). Be very careful—selecting the wrong disk will affect the wrong drive.
  4. Type select disk X (replace X with the actual number) and press Enter. You should see “Disk X is now the selected disk.”
  5. Type attributes disk set readonly and press Enter. This makes the entire disk read-only.
  6. Type exit and press Enter to close Diskpart.

To undo this later, repeat steps 1–4, then type attributes disk clear readonly.

Method 2: Using Registry Editor (For a Specific Drive Letter)

  1. Press Windows + R, type regedit, and press Enter. Click Yes if prompted.
  2. Navigate to: HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies. If the StorageDevicePolicies key does not exist, right-click on Control, select New > Key, and name it StorageDevicePolicies.
  3. Inside that key, right-click on the empty space, select New > DWORD (32-bit) Value, and name it WriteProtect.
  4. Double-click WriteProtect, set Value data to 1, and click OK.
  5. Close Registry Editor and restart your computer. This makes all removable disks write-protected.

To undo, set WriteProtect back to 0 and restart.

Method 3: Using File Explorer (NTFS Permissions)

This method only works on NTFS-formatted drives and protects files from being modified by standard users—not from administrators or system processes.

  1. Open File Explorer and right-click the drive you want to protect. Select Properties.
  2. Go to the Security tab and click Edit.
  3. Select the user or group you want to restrict (e.g., “Users”).
  4. In the Permissions list, check the Deny box for Write.
  5. Click Apply, then OK. Confirm any security warnings.

This prevents that specific user from writing, but the drive is not globally protected.

Common Mistakes

  • Selecting the wrong disk in Diskpart—this can make your system drive read-only and cause boot issues. Always double-check the disk number and size.
  • Using the registry method on internal drives—the WriteProtect registry value affects all removable disks, not internal partitions. It will not work for your C: drive.
  • Forgetting to restart after registry changes—the setting only takes effect after a reboot.
  • Assuming NTFS permissions protect against administrators—an admin can always take ownership and change permissions back. This method is for casual protection, not security.
  • Not backing up data before using Diskpart—while Diskpart itself doesn’t format, if you accidentally select the wrong disk and then try to clean it, you lose data.

Tips

  • For a physical write-protect switch on SD cards or some USB drives, use that first—it’s the simplest and most reliable method.
  • If you want to protect only certain files or folders, consider setting them to “Read-only” in Properties instead of the whole disk.
  • Test the write protection by trying to copy a small file to the drive. If it fails with an “Access denied” or “The disk is write-protected” error, it worked.
  • Keep a note of which method you used, so you can reverse it later. Diskpart and registry methods are easily reversible.
  • For long-term archival, consider using a write-once medium like a CD-R or DVD-R instead of relying on software protection.

Troubleshooting

“Access denied” when running Diskpart—Make sure you launched Terminal or Command Prompt as Administrator. Right-click the Start button and choose “Terminal (Admin)”.

Diskpart says “The disk is write-protected” when you try to set attributes—This means the disk already has a read-only attribute set, possibly from a physical switch or a previous attempt. First, try attributes disk clear readonly to reset it, then set it again.

Registry method doesn’t work—Ensure the path is exactly correct. A common typo is missing the “s” in “StorageDevicePolicies”. Also, confirm the value type is DWORD (32-bit), not QWORD. Restart after changing the value.

NTFS permissions don’t stop writes—Check that the user you denied is the one actually trying to write. If you’re testing as an administrator, the deny rule may not apply because administrators have higher privileges. Log in as a standard user to test.

Drive still writable after using Diskpart—Some USB enclosures or card readers ignore the read-only attribute. Try a different USB port or reader. Also, verify the disk number again—if you selected the wrong one, the correct disk remains unprotected.

Cannot remove write protection later—If you used Diskpart and “clear readonly” fails, the disk may have a physical switch or a failing controller. Try the registry method to override, or test the drive on another computer.

Frequently Asked Questions

Will making a disk write-protected damage my files? No. It only prevents changes. Existing files remain intact and readable.

Can I still read files from a write-protected disk? Yes, reading is always allowed. You just cannot add, modify, or delete files.

Does write protection stop malware from infecting the disk? It stops malware from writing to that disk, but malware running on your system can still read from it. It’s a good defense, not a complete one.

Can I make my C: drive write-protected? Technically, you can use Diskpart on any disk, but making your system drive read-only will likely cause Windows to crash or fail to boot. This is not recommended.

How do I know if a disk is already write-protected? Try to copy a file to it. If you get an error like “The disk is write-protected,” it’s already protected. You can also run diskpart > select disk X > attributes disk and look for “Current Read-only State: Yes”.

Is there a way to password-protect a disk instead? Yes, you can use BitLocker (built into Windows 11 Pro and Enterprise) to encrypt the drive. This requires a password or recovery key to access, but it does not make the disk read-only—you can still write to it once unlocked.

Related

General steps for current mainstream versions; menus can differ by device and version. See the disclaimer or report an error.

More in this bed

The whole Tech How-To bed →