Category Archives: Antivirus

How to make a USB flash drive Read-Only

Have you ever had to use a USB flash drive to install or update an Antivirus program on an infected computer only for your flash drive to get infected? I have, so I started to use my old 256mb USB flash drive, which has a manual switch on the side to make the device Read-Only, this allowed me to install or update the computer knowing that it couldn’t get infected. Some of these are still available, but, they cost a lot more than a standard USB flash drive.  I decided to look at how I could use a standard flash drive as my old 256mb flash drive is getting old, so I investigated for other possible solutions and I found that the diskpart command line tool that is available on Microsoft Windows computers (and it’s FREE) is able to make any flash drive Read-Only, this provided me with what I needed.

Here are the instructions on how to make a USB flash drive Read-Only.

  1. Start by running a command prompt (as administrator)
  2. Type “diskpart
  3. Type “list disk” and take note of the number for your flash drive
  4. Type “select disk [USB drive number]” e.g. “select disk 3
  5. Type “attributes disk” to display the settings (see images below)
  6. Type “attributes disk set readonly
  7. Type “exit“, all done you can now test the flash drive to see if you can add or edit the contents of it.

When you need to add files to the flash drive, you will need to clear the readonly flag. Repeat steps 1 to 5 and then type “attributes disk clear readonly” then “exit

 

Note: This method has been tested using FAT32, exFAT and NTFS file systems.

DISKPART command showing Read-Only flag is set to No

DISKPART command showing Read-Only flag is set to No

DISKPART command showing Read-Only flag is set to Yes

DISKPART command showing Read-Only flag is set to Yes