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.

Robey Thomas

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

Recent Posts

The Ultimate Guide to Honda Talon Windshields: Enhancing Your Off-Road Experience

The Honda Talon is a high-performance UTV designed for adventure, speed, and navigating tough terrains.…

3 months ago

The Benefits and Uses of a Portable Refrigerator: A Comprehensive Guide for Travelers and Adventurers

For those who spend a lot of time traveling, camping, or engaging in outdoor activities,…

3 months ago

How to Maximize Your ROI with a New York SEO Agency?

Every business is striving to capture the attention of its target audience and achieve a…

4 months ago

Mastering MS Access Repair: Troubleshooting Methods for DBAs

Microsoft Access database is a data management system that is used to manage and analyze…

5 months ago

Selecting the Best Battery for Inverter: Factors to Consider

Electricity is both a necessity and a luxury, and having a reliable inverter is a…

5 months ago

5 Innovative Uses of GenAI Labs for Streamlining Business Processes

Streamlining operations is crucial for businesses seeking efficiency and competitiveness in today's fast-paced market. Organizations…

5 months ago