If your USB is write-protected, you may be unable to modify files or reformat the drive. There are several methods to remove write protection from a USB. However, the drive might also be damaged or locked by protective software, making it impossible to overwrite. Today, Mytour will guide you on how to disable write protection on a USB using a Windows or macOS computer.
Steps
Using Diskpart (Windows)

Slide the switch on the USB. If the USB has an external physical write-protection switch, it might be in the locked position. Try sliding the switch to turn off write protection before proceeding with this method.
- In some cases, the USB might be locked by protective software that prevents any changes to its contents. If so, you may not be able to remove the write protection.

Insert the flash drive into a USB port on your computer. You can use any available USB slot on your PC.



Click on Run at the bottom of the menu that appears when you right-click the Start button. The Run program will open in a new window.

Type diskpart into Run and press ↵ Enter. Diskpart will open in the Command Prompt.

Type list disk and press ↵ Enter. A list of disks (including the USB) will appear. Each disk is labeled "Disk (number)" with a unique number representing that disk.
- You can identify the USB by checking the disk size listed under the "Size" column. For example, if the USB is 32 GB, "32 GB" or a similar figure will appear under "Size" in the Command Prompt.

Type select disk # and press ↵ Enter. Replace # with the number representing your flash drive (e.g., "select disk 3"). The USB will now be selected in Diskpart.

Type attributes disk clear readonly and press ↵ Enter. The write protection status will be removed from the disk.

Type clean and press ↵ Enter. All data will be erased from the disk. Once completed, you can proceed to set it up for use.

Type create partition primary and press ↵ Enter
to create a partition on the flash drive.

Type format fs=fat32 or format fs=ntfs and press ↵ Enter. This command will format the drive to be readable across all operating systems. If the USB has less than 32 GB of storage, use "format fs=fat32". For flash drives with more than 32 GB, use "format fs=ntfs".

Type exit and press ↵ Enter to return to the standard command prompt. Your USB is now ready for storage and other uses.
Using Registry Editor (Windows)

Slide the switch on the USB. If the USB has an external physical write-protection switch, it might be in the locked position. Try sliding the switch to turn off write protection before proceeding with this method.

Open Windows Registry Editor on your PC by:
- Pressing ⊞ Win+S to open the search bar.
- Typing regedit into the search field.
- Clicking on Registry Editor from the list of results.
- Clicking Yes to launch the application.

Navigate to the Control folder. Go to the Control folder in the system registry. Here, you will see various directories. Follow these steps:
- Click on the HKEY_LOCAL_MACHINE folder.
- Click on the SYSTEM folder.
- Click on the CurrentControlSet folder.
- Click on the Control folder.

Click on the StorageDevicePolicies folder (if available). If this folder is in the left pane (under the "Control" folder), double-click it to display its contents in the right pane. If you don’t see this folder, follow these steps to create it:
- Right-click on an empty space in the right pane to open the context menu.
- Select New and then Key from the menu.
- Type StorageDevicePolicies and click anywhere to save the new key.
- Click on StorageDevicePolicies in the left pane to open the folder.
- Right-click on an empty space in the right pane and select New > DWORD.
- Type WriteProtect and click anywhere to save the DWORD.

Double-click on WriteProtect in the right column. A dialog box will appear.

Enter "0" as the "Value Data" and click OK. Note: enter the number 0 without quotation marks.

Close Registry Editor and restart your PC. Changes made in the Registry Editor typically take effect after a system reboot.

Plug the USB into your PC and open File Explorer. You can open File Explorer by pressing ⊞ Win+E or right-clicking the Start menu and selecting File Explorer.

Right-click the flash drive and choose Format. Options for erasing and reformatting the drive will appear.

Select the format options and click Start. The contents of the flash drive will be erased, and it will be ready for use.
- If this method doesn’t work, try the "Using Diskpart (Windows)" approach.
Using Disk Utility (Mac OS X)

Slide the switch on the USB. If the USB has an external physical write-protection switch, it might be in the locked position. Try sliding the switch to turn off write protection before proceeding with this method.

Plug the write-protected flash drive into a USB port on your Mac.



Click on the Applications folder in the left pane. Several icons will appear in the right pane.

Double-click on the Utilities folder in the right pane.

Double-click on Disk Utility. The option with a hard drive icon and a stethoscope in the right pane. The disk formatting tool will open.

Select the flash drive in the left pane. Some information about the drive will appear in the right pane.

Click on the Erase tab near the top of the right pane.

Enter a name for the drive (optional). You can keep the default USB name if you prefer.

Select the file system type from the "Format" menu. If you want the flash drive to be compatible with both PC and Mac, you can choose MS-DOS (FAT) (for USB drives under 32GB) or ExFAT (for USB drives over 32GB). Otherwise, select the Mac file system of your choice.

Click the Erase button at the bottom right of the active window. The Mac will reformat the write-protected USB and change the Sharing and permissions status to “read and write.”
- If this process doesn’t resolve the issue, the flash drive may be physically damaged, and you should consider replacing it.
Tips
- If you’re trying to access or use a write-protected USB on a Mac, consider formatting the drive on a Windows computer first. In some cases, the USB may appear as “read-only” on a Mac due to file system incompatibility between Apple and Windows.
Warnings
- If the USB is faulty or physically damaged, the instructions for formatting a write-protected flash drive in this article may not work. If the flash drive still cannot be formatted after following the steps above, consider purchasing a new USB.