Technology Explained

How to Fix the Disk is Write Protected USB Error

Gavin Phillips Updated 05-11-2018

You’ve finished work for the day. The only thing left to do is stick the files onto a USB flash drive. Then you get this message: “The disk is write protected. Remove the write protection or use another disk.” You immediately pull your hair out. This is your USB stick; you should be able to read, write, and do whatever you want with it!


Okay, you didn’t pull your hair out. You stayed nice and calm. But you definitely need to get your USB drive fixed. Luckily, there are a few simple steps to fix write protection on a USB drive. It’s just technology. You can fix it.

1. Check the USB Stick for Viruses

Every time you plug a USB drive into your computer, you should be automatically scanning it for viruses 5 Ways Your USB Stick Can Be a Security Risk USB drives are useful for so many different things, but they can be problematic and dangerous if you don't take the right precautions. Read More —especially if you have used it on a computer that you don’t own, or a public computer.

Viruses often act in a manner that will fill your USB drive with nonsense files and this can make your USB drive respond with the Write Protected error.

Depending on your antivirus software, you may be able to configure it to automatically scan a USB drive when first plugged in. If not, you can navigate to the USB drive in Windows Explorer, right-click, and force a manual antivirus scan.

Scan with Windows Defender


If you do find a virus, eliminate it using your antivirus software. At this point, I would advise performing a full system scan after updating your virus definitions. If there is one virus lurking on your USB drive, you never know what might be propagating on your main system.

2. Check the USB Drive Body

Normally I’d make something this simple the first step. However, I’d rather see you protected from a virus, instead of starting with the simpler fixes. Some USB sticks have a mechanical switch on them that puts them into Write Protect mode. This can be a very small slider switch which may have caught on something in your pocket or computer case.

USB flash drive

If this is the situation, then simply move the switch to the unlocked position and try to copy files again.


Luckily, there aren’t a lot of newly manufactured USB sticks with these locks on them anymore.

3. Check to Make Sure the USB Stick Isn’t Full

You may see the Write Protected error message if your USB stick is full.

Open Windows Explorer, and browse to My PC. This gives you an overview of all drives connected to your system. Right-click your USB drive and select Properties. You’ll be presented with a delightful donut-chart (what was wrong the venerable pie-chart, Microsoft?) displaying your current drive capacity.

USB Windows properties


As you can see, I’ve got room to spare. But if your USB drive is completely full How to Recover Lost Space on a USB Drive If your USB drive ever shrinks in capacity, there's a very simple solution you can use to restore all of that lost space. Read More , it can return a Write Protection error message.

4. Remove Individual Files With Write Protection

Sometimes a single file can upset the balance. Perhaps one file is marked “read-only,” and refuses to be deleted from the drive. This causes an entirely different error message, but it can be off-putting, nonetheless.

Browse to your USB drive, and locate the offending file. Right-click, and select Properties. At the bottom of the panel, under Attributes, ensure Read-only is unchecked.

Windows file attributes


Sometimes single filenames become corrupted. In addition, long filenames are an inherited Windows feature, ingrained in the MS-DOS architecture. The long and short of it is that if a filename exceeds 255 characters, you’re going to have a bad time.

Saikat Basu has explained exactly how to delete files with long filenames. Check it out, save yourself some bother, and fix your USB flash drive.

Long File Name error

5. DiskPart Command Prompt Utility

Are you familiar with the Command Prompt? 7 Common Tasks The Windows Command Prompt Makes Quick & Easy Don't let the command prompt intimidate you. It's simpler and more useful than you expect. You might be surprised by what you can accomplish with just a few keystrokes. Read More Well, you’re about to familiarize yourself a little bit more. Don’t worry, it really isn’t scary, and is the next logical step in our effort to fix your USB stick.

Hit Windows key + X, and select Command Prompt (Admin) from the menu. Type diskpart, and press Enter (1. in the below image). Next, type list disk, and press Enter. You should see a list of currently mounted disks, like so (2. in the below image):

diskpart command prompt

Make sure you can see your USB drive. Mine is Disk 4. Make a note of your disk number. Now enter the following command:

select disk [your disk number]

Once selected, enter the following command:

attributes disk clear readonly

You’ve cleared any remaining read-only file attributes from the USB drive.

Disk attributes cleared successfully

6. Clear Write Protection Error in Windows Registry

If none of the previous steps have solved your Write Protection error, don’t worry. We’ve still got a few more tricks in the book. Next, we’re going to edit the Windows Registry. If you’re not comfortable editing the registry, I understand. You can skip to the next section—how to format your write protected USB drive. If that step is a little too drastic, I’d advise giving this option a try.

Press Windows Key + R to open the Run dialogue. Type regedit and press Enter. Now, navigate to the following registry location:


Look for a key named WriteProtect.

If it exists, double-click it. This will open the Edit DWORD (32-bit) Value box. You can now set one of two values: 0 or 1. 1 means “Yes, write protect my USB storage devices.” Conversely, 0 means “No, don’t write protect my USB storage devices.” Set the value to 0, and then press OK.

But There’s Nothing There?

In some cases, there is no WriteProtection registry entry. In this instance, we can create a registry key of our own. Check out the short video I’ve made below:

(Something gone wrong? Reset the Windows registry to default. How to Reset the Windows Registry to Default If you've messed up the Windows Registry, hopefully you have a backup. If not, you have a short list of options to fix the problem. Read More )

7. Format the USB Drive

Warning: Make sure that you back up all the files and information from your USB drive to your computer. All data will be lost once you format the USB drive.

Formatting the USB stick is a last resort. However, it should make your USB drive able to be read and written to. Prior to formatting the USB drive, determine what kind of file system it already has — NTFS or FAT32. Normally the file system that it already has will be the file system that is best suited for the drive.

Open Windows Explorer, and browse to My PC. This gives you an overview of all drives connected to your system. Right-click your USB drive and select Properties.

USB file system

Close the Properties window. Now, right-click the USB drive again, this time selecting Format. The Format window contains several customizable options, such as the aforementioned File system, the Allocation unit size, the Volume Label, and the Quick Format option.

Format USB device

Change the Volume label to something memorable. As we are dealing with a potential hardware issue, uncheck the Quick Format box. That will force the format to do more than just erase files. For instance, if there is a bad sector on this USB drive, the “full” format will return an error.

Formatting won’t take long, but the larger the drive, the longer you’ll have to wait. Assuming there is no physical problem with the drive, your USB drive will be formatted, cleaned and ready to go How to Format a New Internal Hard Drive or Solid State Drive If you have a new HDD or SSD, you should format it. Through formatting, you can wipe old data, malware, bloatware, and you can change the file system. Follow our step-by-step process. Read More .

8. But I’ve Got an SD Card

Luckily, the majority of the USB drive Write Protection error fixes listed work with SD cards, too.

Unlike regular USB drives, SD cards still tend to come with a physical write protection switch. Ensure this is toggled before you panic.

SanDisk 64GB Class 4 SDXC Flash Memory Card, Frustration-Free Packaging- SDSDB-064G-AFFP (Label May Change) SanDisk 64GB Class 4 SDXC Flash Memory Card, Frustration-Free Packaging- SDSDB-064G-AFFP (Label May Change) Buy Now On Amazon

USB Write Protection Errors, Solved

Sometimes, the problem is simple. Sometimes, the problem is difficult. Hopefully, we’ve found you a solution, in either case. If your USB drive issues persist, it could be that something more significant is afoot. In those cases, such as a deleted Partition Table, third-party software like TestDisk can save the day.

Regardless, you’ve got a lot more troubleshooting tools in your arsenal now and should be able to get your USB drives working again, potentially saving you a tidy sum of money, and the pain of losing all of your files The Best Free Data Recovery Tools for Windows Data loss can strike at any time. We will highlight the best free data recovery tools for Windows to help get your precious files back. Read More !

Related topics: Computer Maintenance, Troubleshooting, USB Drive.

Affiliate Disclosure: By buying the products we recommend, you help keep the site alive. Read more.

Whatsapp Pinterest

Leave a Reply

Your email address will not be published. Required fields are marked *

  1. GuccizBud
    October 2, 2019 at 10:36 pm

    The most likely cause, realistically ( ⁠so number "0" up at the top, lol ⁠), *especially* if the USB stick was mainly used on a Windows desktop or laptop, is simply the stick having been yanked out of the computer one time too many to disconnect it, rather than having been unmounted ( ⁠ejected ⁠) properly, i.e. via the operating system. I would go so far as to say this is the reason more often than all other reasons combined. The average user simply doesn't take the need for proper unmounting of flash media seriously, because 9 times out of 10 it actually won't cause a problem ⁠… because it's not that you WILL leave the device in a corrupt state and/or lose data, it's that you CAN.

    When that does happen, what happens when you eventually reconnect the stick is that the OS sees the corruption and "locks" the stick, meaning it disallows *any* writing to it. It does so because otherwise you would risk worsening the situation and would almost certainly lose data in the process. So you won't be able to write a new file to the stick, or copy ( ⁠or even move ⁠) an existing one, or delete anything, or even rename anything ⁠— ⁠all writes disallowed ⁠— ⁠and were you to right-click any file on the stick, you would note that the pop-up menu would exclude the "Rename" and "Delete" options.

    The fix? If it's Windows, you just need to run CHKDSK with the /F option on the drive letter the USB stick is mapped to. If the stick is drive G᎓ for example, just open a CMD shell and run ⁠…

     chkdsk  /f  g᎓

    If the imposed write-protection is being caused by faulty prior removal of the stick, the above will fix it ( ⁠if it doesn't, then read this article again lol ⁠).

  2. Sarah
    September 10, 2019 at 7:18 pm

    I have a few usb keys that came with some machines the company i work for received. Each key is separated in two disk: one is empty and has a capacity of 3GB and the other is 1GB and full of pdf files system manual for the machine.
    I'm trying to format the 2nd disk and empty it, to use the usb key but it is Write-protected. There are no switches on the usb key to lock/unlock it.
    I've already tried everything below and nothing is working.
    -attributes disk clear readonly says it was erased correctly, but when i type the command clean or format to reformat the usb key, it returns an error message.
    -Formatting like in no7 returns an error message that says ­­"The disk is Write-protected"
    -i tried changing the key in regedit, it wasn't there so i created it like in the video, but it doesn't change a thing.

    Anyone has an idea of what i could do to unprotect the key??

  3. Shuvo
    September 5, 2019 at 10:08 am

    thanks bro..

  4. nelu cociu
    March 7, 2019 at 5:55 pm

    Thank you.Realy helped.

  5. Bob
    December 6, 2018 at 12:27 pm

    In the text the registry key is called "WriteProtect" but in the video it is "WriteProtection", which is correct?

    • Fatin
      May 17, 2019 at 9:12 am


  6. MrsNaniPenny
    November 4, 2018 at 1:38 pm

    My drive just suddenly changed to write-protected in the middle of a file copy. I tried everything above to no avail. But then I decided to plug it into a different USB port on my laptop and suddenly the problem was gone. In addition, I read somewhere that you can only remove the write-protection on a USB from the machine it was enabled on.

    Thought I'd add this note in case it helps someone else too.

    • Rad O'Malley
      January 24, 2019 at 2:11 pm

      Yes, I thought of that, but my USB drive got write protected on my Zidoo TvBox. I don't think it is possible to unprotect an USB drive on a TVBox.
      Anyway I tried all the solutions also on the desk PC, with no luck!

      • Deven
        May 26, 2019 at 12:55 pm

        But I don't know
        From where it enables
        Write protection
        Give an idea

  7. Mike Walsh
    October 1, 2018 at 8:14 pm

    If you're using a SanDisk Cruzer 'Blade', even the above arsenal of tricks may not work. There's a long-running thread on the SanDisk Forums about 'write-protected' Blades, and nobody, repeat NOBODY has ever been able to get these to work once the fault crops up. Even SanDisk themselves advise you to return it for a replacement.

    Seemingly, it dates back a few years to a large batch of faulty controller chips sourced from Hynix. Once SanDisk realised where the problem lay, they tried to get a wholesale refund from Hynix. Hynix refused. Neither side would back down, and the case has been dragging through the courts ever since. The only people to gain from the whole issue so far have been the lawyers.....who, naturally, are trying to make sure it keeps going as long as is humanly possible.....