By Emily / Last Updated October 28, 2019

Need to remove read only using Command Line

“Hi, guys, my Seagate external hard drive is stuck in read only mode, I cannot make any changes to data stored in it, so I need to remove read-only attributes from this disk on Windows 7 using command line. Could you please provide an example on this?"

Read Only Disk

Steps to remove read only attribute via Command Line

When a hard drive is set in read only mode, as its name implies, you will only be able to read data saved in that drive, but cannot add new data and modify the current data. To some degree, this write protection attribute can protect your data from being changed by other people.

But what if you want to make some changes? Then it is necessary to clear the read only attributes from the target disk. To do this job using Command Line (Diskpart service), follow the below instruction.

Step 1. Click “Start” button and type “cmd” in the “Search” box, press “Enter”. Right click the Command Prompt icon and select “Run as administrator”. Then type “diskpart” in the pop-out window and press “Enter” to launch Diskpart.exe utility.

Step 2. Type “list disk” and press “Enter”: to get detailed information about every disk on your Windows computer.

Step 3. Type “select disk” and press “Enter”. Here we select disk 1.

Step 4. Type “attributes disk clear readonly” and press “Enter”: to remove the write protection on the selected disk.

Attributes Disk Clear Readonly

Other methods to clear read-only attribute from disks in Windows 10/8/7

Besides clearing read only attributes by Diskpart, here we would like to share you with some other effective methods to help remove write protection from disks.

Method 1. Edit the registry key

Step 1. Press “Win+R” button at the same time to open “Run” dialogue and type “regedit” and hit on “Enter”.

Step 2. In the Registry Editor window, navigate to the following path:


Step 3. Double click the “WriteProtect” or right click on it, select “Modify” and change the value from 1 to 0.

Write Protect Value

Step 4. Close Regedit and restart your computer. Connect your hard drive again and the read only attribute has been removed already.

Pay attention to: If there is no “StorageDevicePolicies” under the "Control" folder, you can create a rule manually.

Step 1. Right click “Control” folder and select “New” > “Key”. Name it with “StorageDevicePolices” without quotation marks.

Step 2. Then right click on the white space at the right-hand pane and choose “New” ->“DWORD (32-bit) value”. Name it with “WriteProtect”without quotation marks and open it to set the Value data to 0.

Option 2. Reformatting the read only disk

At last, you can format the read only disk to make it writable again. But when you try to format it in Disk Management, you will find the Format option is grey out, in File Explorer, you will receive an error message saying The disk is write protected.

Thus, you can switch to AOMEI Partition Assistant Standard. If your disk becomes read only due to corrupted file system, this freeware allows you to format it with ease in Windows 10/8/7. Moreover, you can also use it to format RAW drive.

Free download it and learn how to format write-protected hard drive step by step.

Warning: formatting will lead to data loss, so you can back up important data on the read only hard drive in advance.

Step 1. Install and launch AOMEI Partition Assistant Standard. Right click the drive with read only attribute and select “Format Partition”.

Format FAT32 Partition

Step 2. Select a desirable file system from the given list, then click “OK” to continue.

Choose NTFS

Step 3. In the main interface, click “Apply” and then “Proceed” to execute the formatting operation.



After you remove read only attribute via Command Line or other recommended methods above, you will be able to add/copy new data to it, and delete or modify data on it. For clearing write protection attribute resulted from disk corruption, AOMEI Partition Assistant helps a lot.

If you upgrade to Professional edition, you can enjoy more amazing functions such as migrating OS to SSD, allocating free space from one partition to another and recovering lost partitions.