How to Set or Remove Disk Read-Only or Write-Protection on Windows 11/10/8/7?

How to set a disk read-only? How can I prevent a disk from accidentally formatting? This risewindows article will answer all these questions. We will show you how to set or remove a particular disk read-only mode on Windows 11/10/8/7 without third-party software.

Why do you need to set a Disk as a Read-Only Mode?

It is better to make the disk or drive read-only where you have stored essential data if you share your PC, external hard drive, or USB flash drive with your friend or colleagues. You or someone else will be unable to delete or format it once the read-only mode is set on any disk or volume. You can protect your data by making your storage device read-only; even a virus will not affect them. Moreover, anyone can open and read the file available on the hard drive, USB drive, or partition.

This risewindows article will learn the following topics:-

  1. How to Set a Disk Read-Only or Write Protect on Windows 11/10/8/7?
  2. How to Remove Read-Only or Write Protect Mode from a Disk on Windows 11/10/8/7?

How to Set a Disk Read-Only or Write-Protect on Windows 11/10/8/7?

You need to follow the below-given steps to set a disk as read-only on Windows PC:-

Step 1. Now, open the Command Prompt with administrative privileges.

cmd-in-Run-boxTo open the command prompt with elevated or administrative rights, press Windows Logo + R keys together to open the “Run” dialog box. Then type cmd and press Ctrl + Shift + Enter to run the command prompt as an administrator.

Next, click on the Yes button to continue if User Account Control (UAC) dialog box appears.

Command-Prompt-UACStep 2. On the Command Prompt window that opens, type the following and press Enter from the keyboard to execute the command:-

diskpart

diskpartStep 3. Then, on the DISKPART prompt, type the below-mentioned command and press Enter from the keyboard to execute it:-Executing the above command will list all the internal and external disks attached to your PC.

Step 4. Note down the disk number which you want to write-protection or read-only. Now, type the following command and press Enter from the keyboard to execute it:-

select disk disk-number

Note: In the above command, replace the “disk-number” with your disk number, which you want to make write protect or read-only. For instance, we will make write protect or read-only to disk 1. Hence, my command will be “select disk 1.”

select-diskStep 5. Finally, type the following and press Enter from the keyboard to make it write protect or read-only:-

attributes disk set readonly

attributes-disk-set-readonlyStep 6. You will see a message on the DISKPART, “Disk attributes set successfully.”

You or someone will not be able to delete or modify any file on that disk once you complete the abovementioned steps. Even you can not format them. You will get the error “The disk is write-protected.”

Write-Protected-Disk

How to Remove Read-Only or Write Protect Mode from a Disk on Windows 11/10/8/7?

You need to follow the below-given steps to remove read-only or write-protection from a disk on Windows PC:-

Step 1. Now, open the Command Prompt as administrative privileges.

cmd-in-Run-box

To open the command prompt with elevated or administrative rights, press Windows Logo + R keys together to open the “Run” dialog box. Then type cmd and press Ctrl + Shift + Enter to run the command prompt as an administrator.

Next, click on the Yes button to continue if User Account Control (UAC) dialog box appears.

Command-Prompt-UACStep 2. On the Command Prompt window that opens, type the following and press Enter from the keyboard to execute the command:-

diskpart

diskpartStep 3. Then, on the DISKPART prompt, type the below-mentioned command and press Enter from the keyboard to execute it:-

list disk

list-diskExecuting the above command will list all the internal and external disks attached to your PC.

Step 4. Note down the disk number which you want to write-protection or read-only. Now, type the following command and press Enter from the keyboard to execute it:-

select disk disk-number

Note: In the above command, replace the “disk-number” with your disk number, which you want to make write protect or read-only. For instance, we will remove write-protection or read-only to Disk 1. Hence, my command will be “select disk 1.”

select-diskStep 5. Finally, type the following and press Enter from the keyboard to remove it from write-protection or read-only:-

attributes disk clear readonly

attributes-disk-set-readonlyStep 6. You will see a message on the DISKPART, “Disk attributes cleared successfully.”

When you complete the steps mentioned above, the read-only or write-protection mode will remove from the selected external hard disk drive or USB flash drive. Now you can edit or format the external disk if you need.

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: