When using windows, viruses are always a concern. There are too many sources through which your system can be easily infected by a virus. One such way is using your flash drive on some other computer, which might have already been infected by viruses and using it back on your own system. This way, the virus present in that system could easily get into yours through the usb. You can avoid this by making your usb drive write-protected, thereby preventing viruses from writing malicious codes into your usb. This might not be necessary if your computer is protected by an Antivirus. However, for people like myself who are too lazy to have an antivirus checking files in and out of their system every time, this would be highly helpful in protecting their computers from viruses to some extent. The following steps will help you in making your usb drive write protected. Here we go!
Quick steps :-
1. Insert your usb drive into the computer.
2. Goto Start >> All Programs >> Accessories >> Run and then type diskpart.
3. Now type list disk in the command line which would display all the available storage devices in your PC.

4. Note the disk number for your usb drive and type select disk x where “x” is the usb disk number.

5. Type the following command as it is without the quotes.
“attributes disk set readonly”

6. Once given the above command and hitting enter, your usb drive is made read only i.e write protected. You will be able to read files from your usb drive but cannot write anything into it. This way your usb drive is protected from viruses.

7. Now if you want to revert the settings back to normal, type “attributes disk clear readonly” by selecting the same disk in diskpart. That is it!
Note:- Please remember that the tutorial here is only to protect your usb drives from viruses. This can’t guarantee the safety of your computer from other source of viruses. So, I would still advice you to go for a good antivirus for complete protection from viruses. If you have anything to say, share it in the comments section below!

Hello kcub, I would have never thought of getting a virus that way. Yes with Windows we always have to be careful because there’s so many ways our computers can and will be infected.
Have a great day my friend
RobG recently posted…How Would You Rate your Self As a WordPress Web designer And Coder?
Yes RG, one must be too careful about viruses while using windows. windows has both its own plus and minuses. Thanks for stopping by my friend!
kcube recently posted…Protect USB drive from Viruses
This is a pretty nice tweak, but if its write protected how we will be able to save content on it?
Usman recently posted…ForexGold – New HYIP Program !
Hello Usman,
Its nice to meet you. To save files, you have to follow the 7th point here to make it read and write. This tweak is helpful when you already have some files written on your usb and lending it to your friend or someone who may use it on his PC. So by write-protected, he would be able to copy files from usb but not likewise. Hope you get it. See you around!
kcube recently posted…Protect USB drive from Viruses
Very creative way to use this trick,I was about to ask the same question and u did answer well.I hope you can write about same trick implementing in Linux based OS.
Good going Karthik
Vivek R recently posted…How to add Newsletter Widget below the content in Genesis Child Themes
Hi Vivek,
Thanks for bringing it up. Will surely write for Linux soon enough. Your input is always a pleasure. See You around!
kcube recently posted…Protect USB drive from Viruses
Wow Karthik, this is a question from few years I have been struggling. Most of the time many systems get affected to virus from pen drives. I always think if pen drives could be protected and nice tutorial.
Could you write your next post on anti virus, which one to choose and their prices. Eset is good and Kaspersky is affordable but I want to hear it from you. Waiting for your next post…
Vijesh recently posted…Imparting positive attitude to your blog readers
Hey Vijesh,
Thanks for stopping by. I will definitely write an article about choosing antivirus based on price and other features in the coming days. Stay connected!
kcube recently posted…Protect USB drive from Viruses
Thanks Karthik.
But can I do the same to protect my Hard Disk from viruses?
Thanks
Amal Rafeeq recently posted…Best Ways To Write Killer Blog Posts Ultimately
Hey Amal, you are welcome
Of course you can do the same for hard disk too. But the commands are slightly different. Will write for it soon. Thanks for stopping by!
kcube recently posted…Protect USB drive from Viruses