Categories: Computer

How to Set or Clear Write Protection via CMD on your USB flash drive

When copying files or formatting your USB drive, if your computer says that ‘The disk is write protected‘ or something related to it means that the disk drive is currently has write protection enabled or real-only attribute is set, even you can not delete any files from the USB unless the real-only attribute will not be remove.

As shown in the screenshot below, when I try to format a write protected USB drive, I see the message.

How to know if write protection is enabled on USB?

Connect the USB and launch command prompt on your Windows PC as an administrator, type the following command in CMD and press Enter after each one:

Diskpart
List Disk
Select Disk X, where X is the disk number of your USB drive.
Attributes Disk

As you can see in the screenshot given above, if the value of ‘Current Read-only State‘ and ‘Read-only‘ is ‘Yes‘, that means write protection is currently enabled on your USB.

Enable / Disable USB write protection on Microsoft Windows

Follow the steps below:

  1. Connect the USB flash drive to your Windows PC.
  2. Launch Command Prompt (CMD) as Administrator (search ‘cmd’ in the start menu, right-click on Command Prompt and select ‘Run as administrator’).
  3. In the CMD type the following command and press enter after each command:
    Diskpart
    List Disk
    Select Disk X, where X is the disk number of your USB drive.

  4. To enable write, deletion, and format protection, just type the following command and press enter:
    Attributes Disk Set Readonly

  5. To disable write, delete, and format protection:
    Attributes Disk Clear Readonly

Write Protection work on other computers?

No, because it applies only to a computer or a PC that you used to enable the protection. If you connect the USB to another computer, then write protection will no longer work. Some USB manufacturers provide a hardware button or any software that enables write protection for all computers. Please check your USB manufacturer’s website for more information.



[custom-twitter-feeds feed=2]
Robey Thomas

This is a Stuff profile. Credit of Stories goes to all team of Vintaytime, Thank you.

Recent Posts

The Hidden Challenges of Buying and Selling Vintage Furniture Online

Vintage furniture has become increasingly popular among people looking to create homes with more character.…

2 weeks ago

How To Build Sales Presentations Buyers Can Scan, Trust, And Act On

Key Takeaways Effective sales presentations connect a buyer’s problem to a clear, credible next step.…

3 weeks ago

How To Build A Helpful 404 Page That Keeps Visitors Moving

Key Takeaways Explain the issue in plain, direct language. Give visitors a small number of…

3 weeks ago

Digital Humans: Where Human-Like AI Fits Into Everyday Life

Key Takeaways Digital humans combine animated characters, conversational AI, voice, and facial expressions to create…

4 weeks ago

The Dangers of Unexpected Visitors

When businesses think about unexpected visitors, they might imagine someone entering their office without permission.…

1 month ago

The 8 Best AI Lip Sync and Face Swap Tools of 2026

AI-powered lip sync and face swap have moved well past novelty-filter territory. These days, marketing…

4 months ago