How to enable and disable write protection on a USB flash drive

Using DiskPart to change read-only settings

You can use the Windows DiskPart command line utility to enable or disable read-only mode on your removable disk.

  1. Press Win+R to open the Run box. Type diskpart and press enter.

Running diskpart from the Windows run box

  1. If you receive a User Account Control prompt asking you for permission to continue, click Yes.
  2. At the DISKPART> prompt, type list disk and press enter.

Using Windows diskpart to list disks

From the size of the disk, you should be able to figure out which one is your removable disk. In this example, we know that Disk 1 is our removable USB thumbdrive because its size is listed as 14 GB.

  1. Select your removable disk with the select disk command. In this example, we want to work with disk 1, so the command is select disk 1.

Using Windows diskpart to select disk

  1. You can list the attributes of the disk with the command attributes disk.

Using Windows diskpart to list disk attributes

  1. To clear the read-only attribute (making the disk writable), use the command attributes disk clear readonly.

Using Windows diskpart to clear the readonly attribute

Or, to set the read-only attribute (making the disk write-protected), use the command attributes disk set readonly.

Using Windows diskpart to set the readonly attribute

  1. When you are finished, type exit to quit the program.

Source: How to enable and disable write protection on a USB flash drive

Leave a comment