How to Set or Remove Volume Read-Only or Write-Protect in Windows 11, 10, 8, or 7?

How to set a volume read-only? How can I prevent a volume from accidentally formatting? In this tutorial, we will answer all these questions. We will show you the steps to set or remove a particular volume read-only mode in Windows 11 / 10 / 8 / 7 without using any third-party software.

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

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

In this gearupwindows article, we will learn the following topics:-

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

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

To set a volume as read-only on Windows PC, perform the following steps:-

Step 1. Open the elevated Command Prompt.

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

If User Account Control (UAC) dialog box prompts, click the Yes button to continue.

Step 2. In the Command Prompt window that opens, type the following and hit Enter from the keyboard to execute the command:-

diskpart

Step 3. Now, on the DISKPART prompt, type the following command and hit Enter from the keyboard to execute it:-

list volume

Once you execute the above command, it will list all the internal and external volumes attached to your PC.

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

select volume volume-number

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

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

attributes volume set readonly

Step 6. You will see a message on the DISKPART, “Volume attributes set successfully.”

Once you complete the above-mentioned steps, you or someone will not be able to delete or modify any file on that volume. Even you can not format them. If you try to format that volume, you’ll get the error “The disk is write-protected.”

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

To remove read-only or write-protection from a volume on Windows PC, perform the following steps:-

Step 1. Open the elevated Command Prompt.

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

If User Account Control (UAC) dialog box prompts, click the Yes button to continue.

Step 2. In the Command Prompt window that opens, type the following and hit Enter from the keyboard to execute the command:-

diskpart

Step 3. Now, on the DISKPART prompt, type the following command and hit Enter from the keyboard to execute it:-

list volume

Once you execute the above command, it will list all the internal and external volumes attached to your PC.

Note: You can’t protect external volumes using these commands. However, it is possible to remove read-only or write-protect using the disk command.

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

select volume volume-number

Note: In the above command, replace the “volume-number” with your own volume number, which is write-protected or read-only. For instance, we are going to remove the write-protection or read-only mode from Volume 2. Hence, my command will be “select volume 2.”

Step 5. Finally, type the following and press Enter from the keyboard to remove write-protect or read-only:-

attributes volume clear readonly

Once you complete the above-mentioned steps, read-only or write protection mode is removed from the selected volume. Now, you can edit or format the volume if you need.

Conclusion

In conclusion, setting a volume as read-only or write-protected is an essential feature in Windows that allows you to protect your data from accidental deletion or formatting. By following the steps outlined in this tutorial, you can easily set a volume as read-only or remove the read-only mode from a volume in Windows 11/10/8/7 without using any third-party software. Protecting your data by making it read-only is a crucial step, especially if you share your PC, external hard disk, or USB flash drive with others. Remember to take caution when removing the read-only mode, as it allows you to modify or format the volume.

Leave a Reply