How to Enable or Disable Write Protection for a Disk Drive in Windows
Write protection (read-only) on a disk prevents the contents on the disk from being changed.
There are many reasons for how a disk is write protected.
This tutorial will show you different ways to enable or disable write protection for a hard drive, memory card, or USB drive for all users in Windows 7, Windows 8, and Windows 10.
You must be signed in as an administrator to be able to do the options below.
You will not be able to write protect the Windows drive.
Sometimes when a SD card or USB flash drive gives a This drive is write protected error, the device may have failed. The write protected error is an attempt to protect from data loss, so you can copy the contents from the device to another storage location. In this situation, nothing can be done for the device. It's dead.
Contents
- Option One: Enable or Disable Write Protection for USB Drive or Memory Card with Physical Switch
- Option Two: Enable or Disable Write Access for All Removable Disks in Group Policy
- Option Three: Enable or Disable Write Protection for Disk using Diskpart Command
- Option Four: Enable or Disable Write Protection for USB Drives using a REG file
- Option Five: Allow or Deny Write Access to Removable Drives not Protected by BitLocker in Group Policy
- Option Six: Allow or Deny Write Access to Fixed Data Drives not Protected by BitLocker in Group Policy
EXAMPLE: "The disk is write-protected." error message
This is the usual error message a user will get when trying to format or write (ex: copy) something to a write-protected disk.
![]()
EXAMPLE: Error 0x8000FFFF: Catastrophic failure
This is an error message a user will get when trying to create a new folder on a write protected disk in Windows 10.
Some USB flash drives and memory cards have a physical switch that allows you to lock or unlock write-protection for it. The location of a switch (if available) on a USB flash drive will vary.
If locked, this will override any other option below, and the device will be write protected on all PCs you connect it to until unlocked.
1 Examine the USB flash drive or memory card for a switch like below. If available, you can move the switch to the locked or unlocked position to enable or disable write protection for the device.
This option is only applied when removable disks are connected to the PC that the policy is set on.
This option is only applied when removable disks are connected to the PC that the policy is set on.
See also: My Disk is Read-only, Help! | Ask the Core Team
1 Open an elevated command prompt.
2 Typediskpart
into the elevated command prompt, and press Enter. (see screenshots below)
3 Typelist disk
into the elevated command prompt, and press Enter. Make note of the disk # (ex: disk 1) for the disk you want to enable or disable write protection for.
4 Type the command below into the elevated command prompt, and press Enter.
select disk #
Substitute # in the command above with the actual disk # from step 3.
For example:select disk 1
5 Do step 6 (enable) or step 7 (disable) below for what you would like to do.
A) Copy and paste the command below into the elevated command prompt, press Enter, and go to step 8 below.
attributes disk set readonly
This is the default setting.
A) Copy and paste the command below into the elevated command prompt, press Enter, and go to step 8 below.
attributes disk clear readonly
8 When successfully finished, you can close the elevated command prompt if you like.
The downloadable .reg files below will add and modify the DWORD value in the registry key below.
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\StorageDevicePolicies
WriteProtect DWORD
(delete) or 0 = Disable (default)
1 = Enable
1 Do step 2 (enable) or step 3 (disable) below for what you would like to do.
A) Click/tap on the Download button below to download the file below, and go to step 4 below.
Enable_Write_Protection_to_USB_drives.reg
Download
This is the default setting.
A) Click/tap on the Download button below to download the file below, and go to step 4 below.
Disable_Write_Protection_to_USB_drives.reg
Download
4 Save the .reg file to your desktop.
5 Double click/tap on the downloaded .reg file to merge it.
6 When prompted, click/tap on Run, Yes (UAC), Yes, and OK to approve the merge.
7 Restart the computer to apply.
8 You can now delete the downloaded .reg file if you like.
1 For how, see: Allow or Deny Write Access to Removable Drives not Protected by BitLocker in Windows
1 For how, see: Allow or Deny Write Access to Fixed Data Drives not Protected by BitLocker in Windows
That's it,
Shawn
Related Tutorials
- Allow or Deny Write Access to Removable Drives not Protected by BitLocker in Windows
- How to Turn On or Off Write Protection for Removable Drives in Windows 10
- How to Set or Unset Read-only Attribute of Files and Folders in Windows 10
- Allow or Deny Write Access to Fixed Data Drives not Protected by BitLocker in Windows
- How to Enable or Disable Access to All Removable Storage Devices in Windows
- How to Enable or Disable Write Access to Removable Disks in Windows