Clear Read-Only flag on Disk in Windows 7 using Diskpart

This is a short HOWTO clear the read-only/readonly flag/attribute on a disk in Windows 7 using the diskpart command from a Windows Command Prompt.

Warning!
Be sure to do this on the right disk since the diskpart command can do serious damage if you run it on the wrong disk.

  1. Open a command window by running the diskpart command from a Command Prompt
  2. Determine which disk you are going to modify:
    • DISKPART> list disk
      
      

Disk ### Status Size Free Dyn Gpt


Disk 0 Online 149 GB 1024 KB Disk 1 Online 465 GB 465 GB

  1. Select the disk you are going to modify
    DISKPART> select disk 1
You have now selected disk 1

<pre>list disk

Disk ### Status Size Free Dyn Gpt


Disk 0 Online 149 GB 1024 KB

  • Disk 1 Online 465 GB 465 GB

    1. Clear the Read-Only attribute on the selected disk
    DISKPART> attributes disk clear readonly

The disk is no longe Read-Only protected.

If you would like to set the disk Read-Only again just do the same procedure and write

DISKPART> attributes disk set readonly

in the last operation.

When you are done modifying the disk attributes just issue the exit command

DISKPART> exit

and the diskpart windows will be closed.