The disk is write protected - one message, three completely different causes. A switch on the drive, a setting inside Windows, or the pendrive's own controller locking the memory. Each one has a different fix, and trying them in the wrong order wastes your time.
Before you download any tool, answer one question: where does the lock live? If it lives on the drive's body, no command will help. If it lives in Windows, the drive is innocent. If it lives in the drive's controller, the drive is telling you it is dying. This guide separates the three causes so you fix the right one.
Some older pendrives and almost all SD card adapters carry a tiny sliding switch on the side. Slid one way, the card is locked: Windows can read everything but cannot write, delete or format. Flip it to the unlocked position, reinsert, and test. Also check the adapter if you use a microSD card in a full-size adapter - a loose adapter switch is a classic false alarm that makes a healthy card look protected.
Windows has a policy that makes all removable drives read-only, and some office PCs, school PCs and security tools switch it on. The registry version lives at HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies as a value named WriteProtect. If it is set to 1, change it to 0, restart the PC, and test again. The tell-tale sign: every pendrive is write-protected on this one PC, but the same drives work fine elsewhere.
If only this one drive is locked on every PC, try the video's method. Open Command Prompt, run diskpart, then:
list diskselect disk X - your pendrive, matched by sizeattributes disk clear readonlyexitRemove and reinsert the drive, then copy a small test file onto it. If the write succeeds and survives a reinsert, the lock was just a stuck software flag and you are done.
If the attribute clears and then comes straight back - or diskpart itself reports the clear failed - the lock is not software. The pendrive's controller has detected worn-out flash cells and switched the drive to read-only to protect what is still stored on it. This is the most common cause of all, and it is permanent. Copy off anything you still need while the drive still reads, because reading is the one thing it can still do.
One five-minute routine tells you which cause you have:
attributes disk again - a lock that returns instantly is the controller'sWatch the video to see the attributes command run live and how the result looks on a drive that stays locked.
▶️ Watch Full VideoThe switch is only one of three causes. Modern pendrives are usually locked either by a Windows policy or by their own controller after detecting failing memory. The diskpart attributes command and the two-PC test tell you which one you have.
Changing the single WriteProtect value under StorageDevicePolicies is a normal, reversible Windows setting - set it back to 1 any time. But on an office or school PC that policy was probably set deliberately; ask the IT admin instead of changing it yourself.
That pattern is the signature of controller-level locking: the drive accepts the command but its firmware re-applies the protection. Treat the drive as read-only storage for rescue only - copy your files off and replace it.