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.
- Press Win+R to open the Run box. Type diskpart and press enter.
- If you receive a User Account Control prompt asking you for permission to continue, click Yes.
- At the DISKPART> prompt, type list disk and press enter.
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.
- 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.
- You can list the attributes of the disk with the command attributes disk.
- To clear the read-only attribute (making the disk writable), use the command attributes disk clear readonly.
Or, to set the read-only attribute (making the disk write-protected), use the command attributes disk set readonly.
- When you are finished, type exit to quit the program.
Source: How to enable and disable write protection on a USB flash drive





