How to Unlock a Write-Protected USB Drive, Memory Card, or a Hard Disk in Windows 10, 8 or 7
Tags: beginners, testing, test, tutorial
Published: 2021-09-09 20:58:33

Read this article to find out what to do if you see the message “The disk is write-protected” or “You do not have sufficient rights to perform this operation” when trying to format a USB flash drive, memory card or hard disk. Also, learn how to disable protection and unlock any device if you can’t create a file or copy files to a USB drive or a memory card because the device is write-protected.

![How to Unlock a Write-Protected USB Drive](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hjsj03qfnmnuwvh9eon0.jpg)

You can get similar error messages when working with a computer or laptop, as well as with a mobile phone, tablet PC, TV or car audio. To fix the problem, just follow our directions.

Some models of flash drives, memory cards and external drives can have switches to enable write protection. Most often you can find such switches in SD cards. Examine the device carefully and check the position of the switch (if there is any).

![memory cards](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2mrl6yotophnqp81j9ya.jpg)

Your device may be infected by a virus blocking your attempts to write or format the drive. Check the device with an antivirus and clean it if necessary.

![Antivirus and clean it if necessary](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w3d2tc6j6uhw7xluptyv.jpg)

Write errors may appear when the USB drive is full. Check it for free space and take a note of what file system it is using. With FAT32 file system, you can’t write files larger than 4 GB.

![FAT32 file system](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/fxzfdnl3phgg8vy24e7j.jpg)

Unlock a USB drive with the Command Prompt:

![Unlock a USB drive](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bbhg13oxrof3uxz08elh.jpg)

Launch the Command prompt as Administrator, type the command Diskpart and press Enter.
Type list disk and press Enter.

Find the drive number corresponding to your flash drive. When doing it, the drive size will help you. Type select disk N (where N is the number of the disk that corresponds to the flash drive) and press Enter.

Type attributes disk clear readonly and press Enter. This will unlock the device for writing. We also recommend cleaning and formatting the drive for further use. Take the following steps only if the drive contains no important data.

Type clean and press Enter – it will delete all data on this drive including service information.

Type create partition primary and press Enter – it creates a new partition.

Then type select partition 1 and press Enter.

Type active and press Enter, and the new partition will become active.

Then type format fs=fat32 quick and press Enter – it will format the device in FAT32.

After that, type assign and press Enter to give the flash drive a letter name.

Unlock the flash drive in the Windows registry:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tldpijtwzmlapks75fs5.jpg)

Open the Run window, type the command regedit and press Enter.

Go to HKEY_LOCAL_MACHINE \ SYSTEM \ CurrentControlSet \ Control \ StorageDevicePolicies. If you don’t see it, create it on your own.

Set the WriteProtect value to 0. Create this value if it is absent from your system.

If you see the following message while copying or creating files on your device: You need permission to perform this action.

![You need permission to perform this action](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/uhzs8tqza76pjp48jezq.jpg)

Or if you see this message when trying to format the device: You do not have sufficient rights to perform this operation.
It means you need to remove write protection for this device in the Local Group Policy Editor:

![Alt Text](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hrwa7o1wdptr2vobgrtb.jpg)