iSumsoft » Resources »computer » Enable Write-Protection on USB Flash Drive

2 Ways Enable Write-Protection on USB Flash Drive

Write protection (also called read-only) can make ensure data is not accidentally overwritten or deleted. It prevents files and folders from being changed. Here describes 2 ways to enable write protection for USB flash drive.

Way 1: Turn on Write Protection Lock

Some USB flash drives and SD cards come with Write Protect Switch that allows to protect that drive from writing as well as protect it from malware. Check if there is the lock switch on your USB flash drive and turn it on.

In USB flash drive, move switch to Lock position.
In SD card adaptor, make lock switch downwards to turn on Write Protection.

Turn on Write Protection lock

Way 2: Turn on read-only file attributes via diskpart.exe

Read-only file can be opened and viewed like any other file but writing to the file won't be possible.

Step 1: Open Diskpart.exe.

Press Win + R to open the Run dialog box, then type in diskpart and hit Enter key.

open diskpart.exe

If you receive a UAC prompt asking you for permission to continue, click Yes.

Step 2: In a new command line window, type list disk and then press Enter

From the size of the disk, it's easy to figure out which one is your removable disk. In this example, I know that Disk 1 is my removable USB flash drive because its size is listed as 14 GB.

List disk

Step 3: Run select disk 1 command to select the disk which you'll work with and hit Enter key.

Select removable disk

Step 4: Type in attributes disk set readonly and hit Enter.


You can remove this protection by use the command attributes disk clear readonly. Or remove a write-Protection from USB drive using Regedit.exe.