To set any pen drive to a Read-only state so that inside contents cannot be changed by others. You have to open the command prompt and type the below commands
diskpart
list disk
select disk 1
attribute disk
attribute disk set readonly
To clear readonly
type “attribute disk clear readonly” in CMD