By Delia / Last update May 31, 2023

Sometimes you may encounter a situation where you cannot format, delete or copy new files to a USB drive or memory card. Windows will tell you that the drive is write-protected, then to fix the problem you need to remove the write-protection.

Here are some of frequently used methods you can try.


1. Check if there is a lock button

The first thing you should check is whether there is a lock button on your USB drive. If it does, the drive may be locked by mistake, making it impossible to copy files to it. In this case, simply pressing the button will unlock the drive.

If there is no lock button, you may have to use other Windows tools to fix the problem.

2. Modify regedit

If you are running Windows XP or higher version, you can open Regedit by searching "regedit" directly in the search bar.

Then, go to the following path:


Find and select StorageDevicePolicies under Control folder, and there should be a file named WriteProtect on the right area. Double-click it and change the value from 1 to 0. Then click OK to save the changes and restart your computer.

Now plug your USB drive or memory card back in and the write protection should be gone.

If you can't find StorageDevicePolicies, you can create a key by right-clicking in the empty space of the Control folder and selecting “New” > “Key”. Enter “StorageDevicePolicies” as the name and double-click on the newly created folder.

Now right-click in the empty space again, but this time choose “New” > “DWORD”. give it the name as “WriteProtect” and set its value to 0.


Click “OK” to confirm it, then exit Regedit, and restart your computer to see if it has the desired effect.

3. Use command to format the drive

If the write protection still exists, you can try using the command prompt to format the drive, which will delete all the files on your USB drive or memory card. You can make a backup in advance to avoid unwanted data loss.

Now, press Win+R to open the Run window, type “cmd” in the input box and press Enter. Then you can type the following commands in Command Prompt and press enter after each command line:

list disk
select disk x (x is the number of your USB drive)
attributes disk clear readonly
create partition primary
format fs=fat32 (or ntfs)

Disk Attributes Clear

Once the formatting is complete, your drive will hopefully work as usual again. If you still have problems, the USB drive itself may be corrupted. The smart thing to do is to discard it and buy a new one.