How to set a Pendrive as readonly?

In order to avoid virus attack to your pen drive. kindly set your pen drive  as read only. Open cmd in administrator mode then run the following commands.