November 19, 2026
write Protected Pen drive

When Windows says “The disk is write-protected”, the pen drive has been marked read-only, and you cannot copy, delete or format anything on it. To format a write-protected pen drive, first check for a physical lock switch, then clear the read-only attribute with the Windows DiskPart tool using attributes disk clear readonly, and then format the drive.

Here is the part most guides skip: if the read-only flag comes straight back after you clear it, the drive is usually not locked but dying. Many flash drives switch themselves to read-only when their memory wears out, precisely so you can still copy your files off. No software fixes that. So work through the steps below in order, and treat a stubborn drive as a warning to rescue your data, not as a puzzle to keep fighting.

Updated: 19 November 2026 — fully rewritten with the current DiskPart commands for Windows 10 and Windows 11.

Also read: How to Send Disappearing Messages on Instagram?

Quick summary

StepWhat to doFixes it when
1Check the lock switch, try another port and another PCThe lock is physical or the port is faulty
2Clear the read-only attribute in DiskPartWindows has flagged the disk read-only
3Clean and format the driveThe file system is damaged
4Ask your IT teamAn office policy blocks writing to USB drives
5Copy your files off and replace the driveThe flag returns every time: the drive is failing

Before you start

  • Copy off anything you need. A write-protected drive can normally still be read. Formatting erases everything, so rescue your files first.
  • Unplug other USB drives and external disks. DiskPart acts on whichever disk you select, and it does not ask twice.
  • Use an administrator account. Microsoft states that you must be in the local Administrators group to run DiskPart.

Step 1: Rule out the simple causes

  1. Look along the edges of the drive for a small sliding lock switch. SD cards and their adapters have one, and so do a few pen drives. Slide it to the unlocked position.
  2. Plug the drive into a different USB port, directly on the computer and not through a hub.
  3. Try it on a second computer. If it is writable there, the problem is the first PC, not the drive.

Step 2: Remove write protection with DiskPart

DiskPart is the disk tool built into Windows 10 and Windows 11. Its attributes disk command displays, sets or clears the read-only attribute of a disk.

  1. Right-click the Start button and open Terminal (Admin) or Command Prompt (Admin).
  2. Type diskpart and press Enter.
  3. Type list disk and press Enter. Find your pen drive by its size.
  4. Type select disk 1, replacing 1 with your pen drive’s number. Run list disk again: an asterisk (*) marks the selected disk.
  5. Type attributes disk to see whether “Read-only” is set to Yes.
  6. Type attributes disk clear readonly and press Enter.
  7. Type exit.
diskpart
list disk
select disk 1
attributes disk
attributes disk clear readonly
exit

The size column is your safety check. A 32GB pen drive shows as roughly 28 to 30 GB, while your internal drive will be far larger. If two disks look alike, stop, unplug the pen drive, run list disk again and see which entry disappears.

Step 3: Format the pen drive

If the drive now accepts files, you can format it the normal way: open File Explorer, right-click the drive, choose Format and click Start. If File Explorer still refuses, format it from DiskPart instead.

diskpart
list disk
select disk 1
clean
create partition primary
format fs=exfat quick
assign
exit
  • clean removes all partition and volume formatting from the selected disk. Everything on it is gone, so confirm the disk number first.
  • create partition primary creates a new partition, and DiskPart moves the focus to it automatically.
  • format fs=exfat quick formats it. exFAT works on Windows, macOS and most TVs and handles large files. Use fs=ntfs for a Windows-only drive or fs=fat32 for older devices that need it.
  • assign gives the drive a letter so it appears in File Explorer.

Step 4: If it is an office computer

Many companies block writing to USB drives to stop data leaving the building. In that case every pen drive will look write-protected on that PC and work normally at home. This is a policy, not a fault, and the right move is to ask your IT team instead of trying to switch it off. If your business needs this kind of control, Suprams provides cybersecurity and data loss prevention services.

Step 5: When the drive cannot be saved

  • The read-only attribute returns as soon as you unplug and reconnect the drive.
  • DiskPart reports an error on clean or format.
  • The drive shows the wrong size, or no size at all.
  • It fails the same way on every computer.

Any of these points to a failing drive. Copy your files to another disk straight away, check whether the drive is still under the maker’s warranty, and replace it. Do not keep important files on a drive that has started doing this.

Mistakes people make most often

  • Selecting the wrong disk. One wrong digit and clean wipes your backup drive.
  • Formatting before rescuing the files. The drive is readable now. It may not be later.
  • Downloading “write protection remover” tools. They do nothing DiskPart cannot do, and many carry adware or worse.
  • Forcing a failing drive back into service. It will fail again, and next time it may not let you read it.

Related guides: how to create a bootable USB drive, how to see a drive’s file system in Windows, and HDD vs SSD if you are choosing a replacement for long-term storage.

Frequently asked questions

Why is my pen drive suddenly write-protected?

The usual causes are a lock switch, a read-only attribute set in Windows, a damaged file system, an office policy or a failing drive that has locked itself to protect your data.

Which command removes write protection from a pen drive?

In DiskPart, select the drive and run attributes disk clear readonly. Run attributes disk first to confirm the read-only attribute is set.

Will removing write protection delete my files?

No. Clearing the read-only attribute does not erase anything. The clean and format commands do erase the drive.

Can a write-protected pen drive always be repaired?

No. If the protection returns after every attempt, the drive’s memory is usually worn out and the drive should be replaced.

The bottom line

Check the lock switch, clear the read-only attribute with DiskPart, then format. That fixes most write-protected pen drives in a few minutes. If the lock keeps coming back, stop trying to repair it: copy your files off while you still can and buy a new drive.

Sources

(Visited 215 times, 1 visits today)

About The Author

Leave a Reply

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