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.
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.
| Likeliest cause | A leftover disk flag or registry value |
|---|---|
| Fastest check | Look for a slider; run Get-Disk |
| You need | Administrator rights |
| Data risk | None until you format |
| Last verified | November 2026 |
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.
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.
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.
- Open an administrator promptRight-click Start, choose Terminal (Admin), and run
diskpart. - Pick the stick by sizeRun
list diskand note which number matches your drive’s capacity. - Check the flagAfter
select disk N, runattributes disk. A line reading Current Read-only State : Yes confirms the cause. - Clear itRun
attributes disk clear readonly, thenexitand replug the drive.
diskpart
list disk
select disk 2
attributes disk
attributes disk clear readonly
exitGet-Disk | Format-Table Number, FriendlyName, Size, IsReadOnly
Set-Disk -Number 2 -IsReadOnly $falseIf 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.
| Location | What to look for | Clear it by |
|---|---|---|
| Registry, StorageDevicePolicies | A WriteProtect value of 1 under HKLM\SYSTEM\CurrentControlSet\Control | Set it to 0 or delete the value |
| Group Policy, Removable Storage Access | Removable Disks: Deny write access set to Enabled | Set Not Configured, then gpupdate /force |
| Policy registry key | Deny_Write under HKLM\SOFTWARE\Policies\Microsoft\Windows\RemovableStorageDevices | Delete the value or set it to 0 |
| Work or school management | A setting you cannot edit, or one that returns after a restart | Ask the administrator who manages the PC |
reg query "HKLM\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies" /v WriteProtectIf 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.
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.
- Copy your files to the PCRead-only drives still allow copying out. Do it first.
- Run the checkIn an administrator prompt run
chkdsk E: /fwith your own drive letter and let it finish. - Replug and testTry saving a small file. If it works, the volume was dirty.
chkdsk E: /fIf the check reports bad sectors or the error returns within days, retire the drive.

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.

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.
Keep going
Other pages on this site cover how to set the lock on purpose and why hardware switches behave the way they do.