If your Pendrive is write-protected / Read-only you cannot change your pendrive / flashdrive inside contents. To format a Write-protected Pendrive you need to open the Command Prompt [ CMD ] as administrator and type the below commands in CMD it will change your pendrive from Read-Only state to Write state.
- Open CMD as administrator & type the below commands
diskpart
list disk
select disk 1
attribute disk
attribute disk clear readonly