To make your selected volume read-only, type attributes volume set readonly and press Enter.Next type select volume #, where # is the number of the volume you’re going to lock it as read-only.
How to enable write protection for a disk drive or set your volume read-only? How can I prevent a hard drive from being formatted? In this tutorial we’ll show you how to set a particular disk or volume read-only in Windows 10 / 8 / 7, without using any third-party software.