Table of Contents
Introduction
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“
![01_gpedit](/wp-content/uploads/AutorunVirus_01_gpedit.png)
- Go to Computer Configuration > Administrative Templates > Windows Components > AutoPlay Policies
![02_settings Autorun virus](/wp-content/uploads/AutorunVirus_02_settings-1024x461.png)
- Go to “Turn off Autoplay” > change to enabled for all drives
![03_Autoplay](/wp-content/uploads/AutorunVirus_03_Autoplay.png)
- Go to “Turn off Autoplay for non-volume devices” > change to enabled
![](/wp-content/uploads/AutorunVirus_04_Autoplay.png)
- Go to “”Default behavior for AutoRun” > change to enabled and Do not execute any autorun commands
![](/wp-content/uploads/AutorunVirus_05_Autorun.png)
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.
![](/wp-content/uploads/AutorunVirus_06_DisableAuto.png)
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:\):mkdir \\.\\c:\autorun.inf\nul.Knowit-Now
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).
![](/wp-content/uploads/AutorunVirus_07_Trick_inf.png)
![](/wp-content/uploads/AutorunVirus_07_Trick_Recyc.png)