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

Snowflake (NYSE: SNOW) reported its Q2 FY2026 – Results vs. Expectations

Snowflake (NYSE: SNOW) reported its Q2 FY2026 earnings after market close today, beating analyst expectations…

3 weeks ago

Outlook Deleted Items Folder Missing? Here’s How to Restore It

Recently, we came across a query where the user can’t delete or recover deleted items…

2 months ago

Faster Images, Better Rankings: SEO Benefits of Next-Gen Formats

In the digital world we live in today, how fast your webpage loads is super…

3 months ago

Optimizing eCommerce Image Pipelines for Speed and Conversion

In the fast-moving world of online shopping today, your website only has a few seconds…

3 months ago

Warren Buffet Benjamin Graham Quality Types Undervalued Stocks June 2025

Here are 5 top rated stocks for long term, the criteria used by greatest like…

4 months ago

What Are the Top 9 YouTube Video Downloader

Here are 8 of the top YouTube video downloaders as of 2025, along with their…

4 months ago