If the current state of the USB device is read-only, you can type the command attributes disk clear read-only, and press Enter to remove write protection on the micro SD card or USB. Check if the USB is read-only, if not, type the command attributes disk set read-only and press Enter to enable write protection on USB. Type attributes disk command and press Enter to check the attributes of the USB drive. Replace “*” with the disk number of the USB drive. Type select disk * command, and press Enter.
Check the list of detected disks and find which one is your USB drive. Next, type list disk in Diskpart and press Enter. Type diskpart in Command Prompt and press Enter to open Diskpart window. Press Windows + R, type cmd, press Ctrl+ Shift + Enter and click Yes in User Account Control window to open elevated Command Prompt. To enable write protection on USB flash drives, pen drives, etc. To recover deleted or lost files from USB flash drives, memory cards, computes, external hard drives, MiniTool Power Data Recovery is free. To prevent others from modifying data on the USB devices or avoid accidental data loss or data overwriting on the USB, you can enable write protection on USB drive.