All About Microsoft Windows And Technology !!!

How to format write protected USB or pendrive using cmd

Format a USB drive is simply easy and every user can do this by simply Right-click and select format. But sometimes Windows Users face problems this disk is write-protected, Can’t format the drive, etc. This is because the USB drive is corrupted, has some bad sectors, and may be fully infected with a virus that protects to format of the drive. If you are also struggling with similar problems You can use the Windows command prompt to format write protected Pendrive. This article explores how to format write-protected pendrive using cmd prompt on Windows 10.

How To Format write-protected USB

First of all, Check the write protection switch if available

Some USB flash drives have a physical switch that allows you to lock or unlock write protection. The location of a switch on a USB flash drive will be different. Make sure the lock switch is slid up to unlock position. As You will not be able to transfer files to the USB drive if it is locked.

But If the write protection switch on your USB drive is off and you still get the error message or there is no physical switch on your USB drive, apply the solution below.

How to Format USB using Command prompt

Note: Formatting a USB drive permanently deletes data from the drive. If you have important data on your USB drive We recommend recover them using free Data recovery utility before formatting the drive.

Now follow the steps below to remove the read-only attribute and format the drive.

  • First of all, connect the USB flash drive to your computer.
  • Now open a command prompt as administrator
  • Type the command Diskpart and press the enter key to run the Diskpart tool.
  • Now Execute list disk command to list all the disks in your system.
  • Here identify the USB drive you want to format.

Note: You can generally identify the USB drive using its size. For instance, I’ve plugged in a 16GB pen drive. So my USB drive is represented as “Disk 1”.

  • Now type the command select disk 1 and press enter key.
  • After selecting the disk, run clean command to format the USB drive, you will get Diskpart Succeed in cleaning the disk
  • Then run the command Create partition primary, And run Format fs=NTFS Quick command to format the drive with the NTFS file system.

Always remember to back up important data before formatting, as the process will erase all files on the USB drive.

Format USB using Command prompt

Note: If you wish to use FAT32 file system instead of NTFS, use Format fs=FAT32 Quick command.

  • After formatting, you will not see the USB drive in the File Explorer. then run assign command to assign a drive letter.
  • That’s all you have successfully format the USB drive from the command prompt.
  • Now type the exit command to leave disk part tool and close the command prompt.

Tweak Registry to clear write protection on all devices

But if still, you are still getting The disk writes a Protected error message, Follow the steps below to Tweak the Windows registry to clear write protection for all devices.

  • Press Windows + R, type Regedit, and ok to open the Windows registry editor,
  • First backup the registry database, then navigate the following path,
  • HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control.Right-click Control and click New, then click Key. 
  • Rename the key as StorageDevicePolicies.
  • Again right-click on StorageDevice Policies key on the left side of the pane.
  • Then On the right side, right-click the blank space and click New > DWORD (32-bit) Value.
  • Rename the newly created DWORD as WriteProtect.
  • Note: If you have already this option (StorageDevicePolicies\ WriteProtect), there is no need for you to create a new one.
  • Simply double click on WriteProtect and change its value from 0 to 1.

remove write protection regedit

  • That’s all Close the Registry Editor And restart Windows
  • Now check if the drive working properly.

If not it’s time to buy a new drive, Or you can contact the manufacturer if the drive is under warranty.

Also read:

You might also like
Leave a comment

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More