Write Protect USB › Fix the error

Fix “The Disk Is Write Protected” on a USB Drive

The message appears when Windows mounts a drive read-only, and the drive’s memory is the least likely culprit. Four layers can set the state: a slider on the stick, a flag on the disk, a value on the PC, and the stick’s own controller when its flash is failing.

NewSoftwares.net editorial teamNovember 202610 min read

Quick answer

Check for a physical slider, then run attributes disk clear readonly in diskpart on the right disk, then set WriteProtect to 0 if it exists, then look at Group Policy. If nothing changes the state, copy your files off and replace the drive, because worn flash can lock itself read-only.

At a glance
Likeliest causeA leftover disk flag or registry value
Fastest checkLook for a slider; run Get-Disk
You needAdministrator rights
Data riskNone until you format
Last verifiedNovember 2026
USB drive beside a Windows error dialog reading the disk is write protected, with a diskpart command below

Start here

Work Through the Causes From Cheapest to Costliest

Begin with checks that cost nothing and change nothing: a slider, a second PC and a disk-state readout. Only after those fail should you edit settings, and only after settings fail should you suspect the drive. The route below follows that order so you never format first.

A refused write tells you only that something said no. Our order of attack is slider, second computer, disk flag, PC-level value, drive health, then repair. Moving down the list adds risk at each step, so stop as soon as a write succeeds.

Two-minute test

Plug the drive into a different PC before changing anything. If it writes there, the lock sits in your Windows setup and the drive is fine.

Find the cause in four questions

Answer for the drive that shows the error.

Does the stick or its adapter have a slider or lock tab?

Move the slider to the open end, replug, and try again. Did the error clear?

Does the same drive write fine on another PC?

The lock lives on this PC. Work through the disk flag and the registry and policy sections.

The drive itself is the problem. Copy off what you can now, then read when the drive has locked itself.

Fixed. The slider was the lock. If it drifts, a loose switch is the next suspect.

Hardware

Look at the Slider, the Port and the Adapter

Some USB sticks carry a switch on the casing, and every full-size SD card has a lock tab on its left edge. A tab pushed down, loose or bent can leave the drive read-only even though the setting you are chasing is untouched. Check it with a fingernail before you open a single command window.

The SD tab is only a position the card reader senses, so a reader or adapter that misreads it can flag a perfectly writable card. Slide the tab up, reseat the card, then try a different adapter. For the mechanics, see how switches behave.

Looks lockedTab pressed toward the bottom edge, or a stick slider in the padlock position.
Looks openTab toward the contacts, slider away from the padlock mark, drive writing normally on another PC.

Disk

Clear the Read-Only Flag on the Disk

Windows stores a read-only attribute for each disk it manages, and diskpart can clear it in four commands. The danger is not the command but the disk number: pointing it at your system drive changes the wrong disk, so read the size column and match it to the stick before selecting.

  1. Open an administrator promptRight-click Start, choose Terminal (Admin), and run diskpart.
  2. Pick the stick by sizeRun list disk and note which number matches your drive’s capacity.
  3. Check the flagAfter select disk N, run attributes disk. A line reading Current Read-only State : Yes confirms the cause.
  4. Clear itRun attributes disk clear readonly, then exit and replug the drive.
Clear the disk flag
diskpart
list disk
select disk 2
attributes disk
attributes disk clear readonly
exit
Same job in PowerShell
Get-Disk | Format-Table Number, FriendlyName, Size, IsReadOnly
Set-Disk -Number 2 -IsReadOnly $false
Check the number twice

If list disk shows only one disk, stop. It is your system drive and the USB stick is not detected.

Registry and policy

Remove a Registry or Policy Lock Left Behind

Two places keep a PC-wide lock: the StorageDevicePolicies registry key and the Removable Storage Access policies. Query both, clear whichever is set, and replug the drive. A value that keeps returning after a restart means a domain or device-management policy owns it.

A lock you set months ago, or a previous owner of the PC set, can still be active. Two places hold it.

Where a leftover lock can hide
LocationWhat to look forClear it by
Registry, StorageDevicePoliciesA WriteProtect value of 1 under HKLM\SYSTEM\CurrentControlSet\ControlSet it to 0 or delete the value
Group Policy, Removable Storage AccessRemovable Disks: Deny write access set to EnabledSet Not Configured, then gpupdate /force
Policy registry keyDeny_Write under HKLM\SOFTWARE\Policies\Microsoft\Windows\RemovableStorageDevicesDelete the value or set it to 0
Work or school managementA setting you cannot edit, or one that returns after a restartAsk the administrator who manages the PC
Look for the registry lock
reg query "HKLM\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies" /v WriteProtect

If a managed PC puts the value back, a domain or device policy owns it, and editing locally is pointless. The administrator who set the policy is the legitimate fix.

Drive health

When the Drive Has Locked Itself

Flash memory wears out, and some controllers respond by switching the stick to read-only so stored data stays readable. If the drive fails on every PC, the flag and the registry are clear, and writes still refuse, treat the drive as end-of-life: copy everything off now and replace it.

Signs point the same way: the error follows the drive between computers, Get-Disk reports it healthy but read-only, and the flag returns after you clear it. Formatting rarely helps, because the controller, not Windows, is refusing the write.

Copy first, experiment later

A read-only drive is often a drive in its last weeks. Use it to copy files out and nothing else, and buy a replacement before you spend more time on it.

Repair

Repair the File System Without Losing Files

When the disk flag is clear but one volume still behaves as read-only, a dirty file system is the next suspect. Run a check on the drive letter with the fix switch, which can clear the dirty bit. Formatting erases everything, so treat it as the last step and only after copying your files.

  1. Copy your files to the PCRead-only drives still allow copying out. Do it first.
  2. Run the checkIn an administrator prompt run chkdsk E: /f with your own drive letter and let it finish.
  3. Replug and testTry saving a small file. If it works, the volume was dirty.
Check the volume
chkdsk E: /f

If the check reports bad sectors or the error returns within days, retire the drive.

Folder Protect Drives tab listing drives that can be protected on a Windows PC
A protection tool’s drive list: useful once the drive works again, not a repair tool.

After the fix

Put a Deliberate Lock Back After the Fix

Once the drive writes again, decide whether you want it protected on purpose. A planned lock, set at the right scope, beats an accidental one. Folder Protect documents a write-protected mode for files and drives, which suits readers who want a lock they can switch on and off from one window.

The built-in methods on the main guide set the same state without software. For a front end with a password, the write-protected mode in Folder Protect is documented for Windows 10, 8 and 7; check the product page for newer versions before you rely on it, and test on a spare drive first. If the real worry is strangers opening your files, a password tool such as USB Secure addresses that instead.

Folder Protect settings window with options for protection modes
A settings view where protection modes are chosen. We recommend testing on a spare drive.

FAQ

Questions about the write-protected error

Five answers cover the questions readers ask most after meeting this error: why it appears with no switch, whether formatting removes it, how diskpart behaves, whether malware can cause it and what to do with a locked SD card. Each answer points to the cheapest next check.

Why does Windows say my USB drive is write protected when there is no switch?

Windows sets read-only through a disk attribute, a registry or policy value, or a controller that has gone read-only. Run Get-Disk and check the IsReadOnly column; if it says True, Set-Disk -IsReadOnly $false clears it. If the flag returns, the drive itself is failing and the data should be copied off.

Will formatting a write-protected USB drive remove the lock?

Only if the lock is a stale file-system state. Formatting is refused outright when the disk flag, a registry value or the controller enforces read-only, because a format is a write. Clear the cause first, copy your files off, and then format, since the format erases the contents.

Is it safe to run diskpart on a USB drive?

Yes, provided you select the correct disk. diskpart acts on whichever disk is selected with no confirmation, so compare the size from list disk with your stick before you run anything. If only one disk appears, the stick is not detected and you are looking at your system drive.

Can a virus make a USB drive write protected?

Some malware sets registry values or disk attributes to keep users from removing it, and a lock that reappears after you clear it should raise that suspicion. Scan the PC with up-to-date antivirus, then repeat the fix. A stuck value on a managed PC is far more likely to be an administrator policy.

My SD card says it is locked but the tab is up. What now?

Replace the adapter or reader first, since the tab is only a position that the reader senses, and a bent contact in the adapter can report locked when the card is not. Try the card in a second reader. If every reader agrees, the card has locked itself and its data should be copied off.