How do you fix USB flash the disk is write-protected?

USB flash drives are incredibly useful for storing and transferring files, photos, videos, and more. However, sometimes you may run into an issue where your flash drive seems to be “write-protected”, meaning you can’t add, change, or delete files on the drive. There are a few potential reasons a USB drive could end up write-protected, but thankfully the solutions are usually pretty simple.

What Does “Write Protected” Mean on a USB Drive?

When a USB flash drive is write protected, it means the drive is configured so you cannot modify, add, or delete files stored on it. The drive is locked in read-only mode, so you can view and access existing files but cannot make any changes to the content. Some potential causes of a write-protected USB drive include:

  • The lock switch on the USB drive is slid to the “Lock” position. Many USB drives have a small slider switch that locks or unlocks write capabilities.
  • The drive is physically damaged. If the flash memory or controller chips inside the drive are damaged, it may cause write protection.
  • The drive is infected with malware. Some viruses are designed to lock USB devices and prevent modification of files.
  • The registry entry for write protection is enabled. The registry on some operating systems like Windows has a setting that can control write access.
  • The drive is formatted as read-only. The file system format may be configured to be read-only by default.
  • Drive permissions are restricted. The current user account may not have write access permissions.

So in summary, write protection is usually either caused by physical damage and malware, or by settings and configurations that can be changed or overridden. The good news is that in most cases, the write protection on a USB drive can be disabled with a few simple steps.

How to Remove Write Protection from USB Drive

If you find your USB flash drive or SD card is suddenly write-protected, don’t panic. Here are some tips for removing write protection and regaining full read/write access to your drive:

Check for a Physical Lock Switch

Many USB thumb drives and memory cards have a tiny physical lock switch on the housing, often labeled “Lock” and “Unlock”. Check your drive for a similar sliding switch – if it is in the Lock position, simply slide it to Unlock.

Use Diskpart to Clear Read-Only Attribute

On Windows, open the Command Prompt as Administrator and use the “diskpart” tool to remove read-only status. Type the following commands:

list disk
select disk # (where # is your USB drive's number) 
attributes disk clear readonly

Then exit Diskpart.

Change Registry Write-Protection Setting

The Windows registry may have a key enabling write protection for all USB drives. To check, open regedit and go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies.

If there is a value named WriteProtect set to 1, double-click it and change to 0 to disable write protection. Restart your computer for this to take effect.

Reformat the USB Drive

If all else fails, you can reformat your USB drive to factory default settings. Be aware this will erase all data on the drive. On Windows, you can use the Format tool or Disk Management to reformat and restore full read/write access.

How to Write Protect a USB Drive

Conversely, you may sometimes want to intentionally write protect a USB flash drive. Reasons include:

  • Preventing viruses or malware from infecting the drive
  • Stopping others from accidentally deleting or changing important files
  • Making the drive read-only for data distribution

Here are some ways to manually enable write protection on a USB drive if it doesn’t have a physical lock switch.

Use Diskpart Write-Protect Command

On Windows, use the diskpart command in Admin Command Prompt:

list disk
select disk #
attributes disk set readonly

Change Registry Settings

Alternatively, set the following registry key to enable write protection:

Value: 1

Set Folder/File Permissions to Read-Only

You can also set the drive’s NTFS permissions to read-only access. This prevents files being modified but still allows new files to be written by elevating permissions temporarily.

Use Encryption Software

Encryption tools like BitLocker on Windows or VeraCrypt can be used to encrypt a USB drive, which effectively makes it read-only until decrypted with the correct password.

Physically Damage the Drive

Not recommended, but physically damaging the USB controller chip can permanently write-protect the drive by making it unusable. As mentioned, malware can sometimes cause this kind of damage too.

Other USB Write Protection Tips

Here are some other troubleshooting tips for dealing with write-protected USB drives:

  • Try the drive on a different computer – faulty USB ports can sometimes cause write issues
  • Update your USB drivers to the latest version
  • Check for and remove any malware on your computer
  • Scan for errors and bad sectors using CHKDSK or a disk repair tool
  • As a last resort, low-level format the drive to overwrite the existing block structure

And a few general tips for using USB drives:

  • Always safely eject the drive before removing to avoid corruption
  • Regularly back up your data in case a drive gets damaged or fails
  • Consider encryption if storing sensitive files to prevent unauthorized access
  • Avoid excessive heat, moisture, and physical shocks to extend the drive’s life


Write protection errors on USB drives are fairly common but typically easy to resolve. The cause is usually just a switch in the wrong position or a settings change required. Clearing the read-only attribute or reformatting should get your flash drive back up and running. And if you need to intentionally write-protect a drive, there are options like diskpart, permissions, encryption, and physical locks. With the right troubleshooting steps, you can get your USB device back to full read/write accessibility.