How to Set or Remove Volume Read-Only or Write-Protect in Windows 10 / 8 / 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 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 a 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 10 / 8 / 7?
  2. How to Remove Read-Only or Write Protect Mode from a Volume in Windows 10 / 8 / 7?

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

To set a volume as read-only in 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 10 / 8 / 7?

To remove read-only or write-protection from a volume in 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.

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

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 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 make it 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.

Leave a Reply