Ashfame | Tech Blog |+| Ashfame.com

I blog about blogging, tips and tricks, tutorials, hacking, hardware and reviews.

A niche is less than what I blog about.

Ashfame | Tech Blog header image

Disable USB Autorun to Save PC from USB Viruses

ADVERTISEMENTS

If you are new here. You may want to sign up for e-mail updates or subscribe to my RSS feeds. Thanks for visiting!

Pen drives are very common these days. Everybody has them for their daily data transfer needs and since these are connected to different computers very often, they become a easy carrier of malicious codes (virus, trojans, spywares etc).

How viruses spread from USB/Thumb/Pen drive?

Whenever a USB drive is plugged into a infected computer, virus copies itself to the pen drive and sets it to execute itself when pen drive is accessed by making changes in the autorun.inf. Whenever pen drive is accessed, the autorun.inf calls the executable file of the virus upon which the system gets infected.

How to save your computer from viruses from USB/Thumb/Pen drive?

The most effective method of preventing your system from getting infected is to disable autorun feature of USB devices. DJ tells us about disabling autorun feature on Sizlopedia. He tells us a method in which he uses gpedit.msc and disable autorun feature but the problem is that gpedit.msc is not available under Windows XP Home Edition.

So, I am going to explain how to disable USB autorun feature through registry editing which not only works for WinXP Home but also for any other edition of Windows.

UPDATE : There is a tool for vaccinating against autorun feature too. You better use it. It works far much better than this registry hack.

  • Browse to the following key HKEY_CURRENT_USER\Software\Microsoft\Windows\ CurrentVersion\Policies\Explorer
  • Modify the value of NoDriveTypeAutoRun to ff (hexadecimal)

disable_autorun

Although I must warn you that playing with the registry can be harmful for your system and you might end up re-installing your OS. Before making any changes, I recommend reading How to backup your registry?

disable_autorun_reg

And if you don’t want to edit the registry then you can download this registry entry.

Download Disable_autorun.reg.

Right Click > Save it on your computer > Run it on your computer.

Press Yes when it asks for confirmation for adding the entry into the registry.

This will now prevent any virus from auto executing itself through a USB drive. In addition to this, you must have a good anti virus installed on the system as this method just stops the virus from infecting the system automatically.

Related posts:

  1. How to enable/disable access to USB mass storage device
  2. VirusTotal - Scan files from different anti viruses online
  3. Vaccinate USB drives to prevent virus infection
  4. Disable Orkut + Google Talk integration
  5. Write protect your USB/Thumb/Pen Drive
  6. How to safely remove your USB drive when Safely Remove Hardware icon disappears from the system tray
  7. How to backup your windows registry
  8. View all Video files preview in thumbnails
  9. How to get Flip 3D effect in WinXP
  10. MemTest - Check faulty RAM for errors

Tags:   · · · · 17 Comments

Leave A Comment

17 responses so far ↓

  • 1 Quiz_Master Mar 23, 2008 at 10:33 pm

    This trick will help me a lot. My friend’s PCs get infected by these kinda viruses almost 3-4 times in a month…

    Thanks for this.

  • 2 Ebook Mar 25, 2008 at 11:49 am

    Thanks for this nice tips :mrgreen:

  • 3 Ashfame Mar 27, 2008 at 7:20 pm

    @Quiz_Master, Ebook
    You are welcome.

  • 4 Rakshit Mar 29, 2008 at 8:42 pm

    This is very useful. You don’t know when your system will get infected with viruses. I already implemented it long before.

  • 5 Oscar Apr 23, 2008 at 1:32 am

    Really useful!! What a tip!

  • 6 joshuatly Apr 24, 2008 at 8:49 pm

    yaya, this is what im searching for!

  • 7 Nikolai Elkwood Apr 26, 2008 at 8:12 pm

    Thnx for the tip man!

  • 8 Ashfame Jul 5, 2008 at 1:38 am

    @Rakshit, Oscar, Joshuatly, Nikolai
    You are welcome.

  • 9 ggg Aug 12, 2008 at 12:25 am

    This is nice… Just to explain the registry key. The binary value (8 digits) represent 8 kinds of drives (floppy, CD/DVD ROM, removable…). 1 = don’t allow autorun, 0 = allow autorun, CD/DVD ROM is third from the left, therefore 11011111 (bin) = df (hex) = allow autorun only for CD/DVD ROM. Consequently 11111111 (ff) = forbid autorun for all type of drives. Just to say, HKEY_LOCAL_MACHINE has privilege over HKEY_CURRENT_USER, so check if there is the same key, and if there is, change the value to “df” or “ff”, or add the same key and value to the location as well if you want…

  • 10 maxrioseco Sep 11, 2008 at 10:06 am

    a bit about what we are doing ;)

    nice trick =)

  • 11 zplits Feb 4, 2009 at 10:20 am

    Hi, thanks for this great info. It helped me a lot.

  • 12 Amani Mar 11, 2009 at 3:05 pm

    How can I enter a site which is blocked by the server manager?

  • 13 Stefan Apr 5, 2009 at 9:03 pm

    thank you for the reg key, Ashfame! you have really helped me a lot. greetings from Slovakia!

  • 14 Alessi Apr 8, 2009 at 8:19 pm

    It worked even with my strange laptop version of Home Edition, thanks a lot!

  • [...] updates or subscribe to my RSS feeds. Thanks for visiting! Earlier I have written about how to disabe USB autorun to save the computer from being infected with various sort of malware which adds action in the [...]

  • 16 Ashfame Jun 1, 2009 at 10:30 pm

    The tutorial has been updated to prevent the infection from spreading through optical drives also. Thanks to ggg for the explanation in the comment. Moreover, there is a tool for doing this in a better way. I recommend using that tool instead of this hack now. You can find the link to the tool in the post only.

  • [...] http://blog.ashfame.com/2008/03/disable-usb-autorun-save-pc-usb-viruses/ [...]