by using cmd you can make a flash drive or any volume of your hard disk write protected
1 diskpart
2 list disk
3 select disk # "# is your disk no e.g 1,2,3"
4 attributes disk set readonly "to make your disk write protected"
5 attributes disk clear readonly "to remove the write protection from your disk"