Removing write protection on drives using DiskPart

Open Command Prompt or PowerShell as admin then follow the steps below.

diskpart
list disk

Windows 11-2021-10-05-15-09-53.png

Windows 11-2021-10-05-15-10-13.png

Windows 11-2021-10-05-15-10-24.png

Windows 11-2021-10-05-15-10-39.png

Make note of the disk you want to remove the write lock on from the step above.

select disk x
attrib disk clear readonly

If successful, Command Prompt should output ‘Disk attributes cleared successfully’ You can now exit Command Prompt Keep in mind that drives are often write-locked because they are failing or dead. In those cases, it’s best to back up the data on said drive.