How to Remove Write Protection on Windows 11

Tim Fisher has more than 30 years' of professional technology experience. He's been writing about tech for more than two decades and serves as the SVP and General Manager of Lifewire.

Updated on December 13, 2021 Reviewed by

Ryan Perian is a certified IT specialist who holds numerous IT certifications and has 12+ years' experience working in the IT industry support and management positions.

What to Know

This article explains how to remove write protection on a file, USB device, or SD card. Disabling write protection allows you to make changes (i.e. write) to files instead of just view (i.e. read) them.

Is It Possible to Remove Write Protection?

Removing write protection involves clearing the read-only attribute, and it's completely possible to do this for files, folders, and entire storage devices. How this is done is different depending on what you're dealing with, since there's both hardware and software write protection techniques.

The clearest way to confirm a file is write-protected and not just experiencing an unrelated issue, is if you get a read-only error when trying to overwrite it.

 This file is set to read-only. Try again with a different file name. 

If an entire disk is write-protected, you'll see The media is write protected, if you're trying to make changes from Command Prompt. File Explorer displays this:

The disk is write-protected. Remove the write-protection or use another disk. 

How Do I Remove Write Protection on a File?

Taking a file out of read-only mode is extremely easy. It's as straightforward as opening the file's properties and clearing the read-only check box.

The text file properties menu option in Windows 11.

  1. Right-click the file and choose Properties. You can also get there by left-clicking once and opening the three-dot menu from the top of File Explorer.

The Read-only file attribute check box in Windows 11.

Select OK to save the changes.

Why Can't I Remove Write Protection on USB Devices?

You can! It just might be tricky because USB devices deal with write protection differently than files.

For example, some devices have a physical switch which can be toggled on and off to enable or disable read-only mode. Just make sure the switch in the correct position to enable write mode.

physical write-protection switch on USB device

Windows is responsible for removing write protection on USB devices without a switch, but it's not as straightforward as clearing a 'read-only' check box. You'll notice this if you open the device's properties; this check box is missing. Instead, you can either run some commands or edit the Windows Registry.

Run Diskpart Commands

Accessible via Command Prompt, the diskpart command is one way you can edit the read-only attribute for a USB device.

  1. Launch the Run dialog box and enter diskpart. You can get there by right-clicking the Start menu or searching for Run.

The Diskpart list disk command in the Windows 11 Command Prompt.

Once Command Prompt opens, enter list disk.

select disk 1 
attributes disk clear readonly 

The DiskPart attributes disk clear readonly command in the Windows 11 Command Prompt.

Replacing the word 'clear' with 'set' will enable write protection.

Edit the Registry

This method is a bit more involved and risky if you're unfamiliar with the Windows Registry. But if you follow along closely and back up the registry beforehand, this serves as another way to remove write protection.

This method affects all removable devices used by your computer, not just a particular disk like the diskpart method above. However, you'll probably only need to use this technique if read-only mode was enabled this way, in which case this is simply a reversal.

  1. Search for Registry Editor and open it to this location by expanding the folders in the left column:
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control 

The StorageDevicePolicies registry key menu in Windows 11.

Open StorageDevicePolicies and locate WriteProtect in the right area. If you don't see it, create it by right-clicking StorageDevicePolicies and going to New >DWORD (32-bit) Value.

If you enter 1 instead, it will turn on read-only mode for all current and future removable devices. How do I remove write protection from a USB drive in Windows 10?

If your USB has a lock switch, move it to write versus read-only. You can also use the attributes disk clear readonly Diskpart command or open the Windows Registry Editor to change the WriteProtect value to 0. This process also applies to Windows 8.

How do I remove write protection from a USB drive in Windows 7?

Remove USB write protection in Windows 7 by editing the Windows Registry. Enter Windows key+R > regedit > and go to HKEY_LOCAL_MACHINE > SYSTEM > CurrentControlSet > Services. Next, select USBSTORE > double-click Start > and enter the number 3.