DISKPART

list disk

select disk

attributes disk

attributes disk set readonly

attributes disk clear readonly

exit