The ability to write protect a disk in Windows 10 is something that is very useful, and is actually a lot easier to achieve than most people realise.
So why would you want to write protect a disk? Maybe you have a USB stick with important files on it you don’t want to lose. You could even have an external hard drive containing films that you don’t want someone to accidentally erase.
Note – You can only write protect a disk that is external such as hard drives or USB thumb drives. It’s not possible to write protect disks connected internally to your PC / Laptop. Also this technique isn’t really suitable for SD cards, these should be protected using the cards in-built switch.
Warning – this tutorial uses the ‘diskpart’ command which if used incorrectly can destroy data on a disk. Follow these instructions carefully. Chimpytech can accept no responsibility for damage you may cause to your disks or data from not following these instructions properly.
To write protect a disk
- Before starting this procedure, you will need to be logged in to the computer as an Administrator.
- Make sure the disk you wish to write protect is inserted into your computer, and is recognised by Windows.
- Open an Elevated Command Prompt by right clicking the Start Button and selecting the option ‘Command Prompt (Admin)’.
- Type in the command diskpart and hit Enter.
- Now type in the command list disk (including the space) and hit Enter.
- You will now see a list of disk/drives connected to your computer, carefully make a note of the disk number for the drive you wish to write protect.
- Type the command select disk x (where x is the number of the disk from step 6) and hit Enter.
- Type the command attributes disk set readonly
- Close the Elevated Command Prompt window and you’re all done.
Now when someone tries to write to the disk they will see an error message. The message will vary depending on the write operation attempted, but a selection are shown below.
To enable disk writing
- Use the procedure above up to and including step 7,
- At step 8 now type in the command attributes disk clear readonly