Home > Security, Windows Tricks > How to protect your computer from usb/flash drives viruses

How to protect your computer from usb/flash drives viruses

There are many ways to protect your computer against usb/flash viruses.

1.Don’t use usb/flash drives

If you will not use any usb/flash drive then there is no chance you will get usb/flash drive viruses.

2.Turn of auto play

You can do this by going to Run and type “gpedit.msc” (In windows vista press start menu + R to goto run), then press enter. Now goto

Computer Configuration > Administrative Templates > System

There you will see Turn off autoplay, double click on it and Enable it and select All drives

3.Always right click on usb/flash drive to open it.

Usb viruses executes when you double click on it, it run autorun.inf file hidden in usb, which executes the virus. So if you will never double click on the usb , there is no chance that you will get a virus.

4. Use script before accessing to usb/flash drive

I’ve created this script, which will delete autorun.inf file from your usb drive automatically, so if you will run this script, there is almost 95% chance that you will not get virus in your system.

Create a new file using notepad or any text editor and paste following code in it

@echo off
c:
cd \
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

d:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

e:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

f:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

g:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

h:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

i:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

j:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

k:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

l:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

m:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

n:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

o:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

p:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

q:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

r:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

s:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

t:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

u:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

v:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

w:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

x:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

y:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

z:
attrib -h -r -s *.*
attrib -h -r -s *
del autorun.inf

then save file to “C:\windows\system32\”  as “usbvirusremove.bat” . After saving this file as “usbvirusremove.bat” close the opened code and then whenever you have to use usb, you just have to insert usb, run this file by going to run and type “usbvirusremove.bat” and then it will automatically remove all the autorin.inf files in it

  1. Maryam
    April 26th, 2009 at 01:44 | #1

    awsome start ………. dnt use usb .. :D

    gr8 advise :P

    overall nice work …. simple n to da point

    gud work

  2. April 26th, 2009 at 11:58 | #2

    gpedit doesnt works in VISTA i tried but it says enter the correct word etc
    plz help

    • April 26th, 2009 at 12:02 | #3

      gpedit.msc works in vista ultimate or home premium or business edition
      but in home edition it doesn’t work,
      you can disable autoplay by going to Control Panel, and then click on “Play CDs or other media automatically” to open the AutoPlay dialog.

      There uncheck “Use autoplay for all media and devices”
      and save it,

      I hope this will help

  1. No trackbacks yet.
*