It can be done in two methods
By Third party software
Will tell you both now.
Open a command prompt by click Start -> Run. Type cmd and hit the Enter key.
In the command prompt, create a directory in the root directory of the USB drive (i.e.goto your Pen drive Disk if your pendrive is I then I: with command:
Make a directory named Autorun.ini
Move into this new directory with command:
Create a new directory with command:
Exit the command prompt window with command:
Remove the USB-Disk from the computer and now its immune. And whenever you will plug it into a infected computer the USB won't get infected.
By Third party software:
Bitdefender USB Immunizer
The USB immunizer is BitDefender's response to this growing issue. This small utility is divided in two sections.
The Immunize option allows you to immunize your USB storage device or SD card against infections with autorun-based malware. Even if your storage device has been plugged into an infected computer, the piece of malware will be unable to create its autorun.inf file, thus annihilating any chance of auto-launching itself.Attachment HERE