Table of Contents
Autorun virus uses autorun.inf to run and execute harmful scripts that cause windows errors. they spread commonly through USB flash disks and external hard disks and once your PC got infected, it will copy this virus to any removable device connected to this PC as long as it has access to do. The following lines will show how to protect your computer from autorun virus without using any additional software. Let’s know how to protect your computer from autorun virus.
How to protect your computer from autorun virus
Step 1: Windows AutoPlay Policies
- Open windows RUN dialog by pressing (
windows logo + R) or by search in start menu, then run “gpedit.msc“
- Go to Computer Configuration > Administrative Templates > Windows Components > AutoPlay Policies
- Go to “Turn off Autoplay” > change to enabled for all drives
- Go to “Turn off Autoplay for non-volume devices” > change to enabled
- Go to “”Default behavior for AutoRun” > change to enabled and Do not execute any autorun commands
Step 2: Disable running autorun.inf files
Open command prompt (CMD) and execute the following command:
REG ADD "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\Autorun.inf" /ve /d "@SYS:DoesNotExist"
This command tells Windows “whenever you handle autorun.inf, don’t use the values in the file but instead use the values at “HKEY_LOCAL_MACHINE\SOFTWARE\DoesNotExist” and because this key doesn’t exist, it’s as if autorun.inf is empty. So nothing is added to the explorer double-click action.
Step 3: Create dummy autorun.inf and recycler
Open command prompt (CMD) and execute the following commands for all drives including USB disks (in this example drive is C:\):
attrib +s +h +r c:\autorun.inf
echo Knowit-now.com> c:\recycler
attrib +s +h +r c:\recycler
These commands create a folder named autorun.inf and a file named recycler and change their attributes to (system, read only and hidden files).