Enable or Disable write protection to a USB drive

PROBLEM: I need to stop users saving data to a bitlocker usb flash drive that they use to unlock their laptop.

SOLUTION: Use the DiskPart command line utility to enable read only access to the USB flash drive in question.

STEPS:-

  1. Press the Windows key + R to open the run box.
  2. Type diskpart and press enter.
  3. If you receive a UAC prompt asking for permission click Yes.
  4. At the DISKPART > prompt type list disk and press enter.
  5. Figure out which is your USB disk based on the size (mine was disk 1) so I typed select disk 1 and pressed enter.
  6. You can check the attributes for the disk by typing attributes disk.
  7. To enable disk write protection (making it not possible to save files to the disk) use the command attributes disk set readonly and press enter.
  8. You’re done! Type exit to quit.
  9. If you ever wanted to revert back and disable write protection then use the command attributes disk clear readonly and press enter.

DiskPart

Please note that the above method will only enable write protection for that particular usb flash drive on that specific windows machine. If you were to put the same usb flash drive in a different machine you can still write files to it.

Leave a Reply