How to Remove autorun virus from pendrive or PC

05. January 2017 Software 0

You can not remove autorun virus manually. Because autorun.inf file may contain system, hidden, archive and read-only attributes.


When you want to delete any file which has any one of these four attributes, first you need to remove those attributes from the file. You can change file attributes by using command prompt.

Here I am going to show you possible methods to remove autorun virus from pen drive or PC.

Method 1 : Create Duplicate autorun.inf file

This method may work for older versions of Windows. It will not work in latest versions. If you have latest version, you can skip this method.

Insert your pen drive into usb slot. Open pen drive. Right click on space. Create a new empty text document with the name “autorun.inf”. Save the document, it will ask you to replace existing autorun file. Click yes. Now you have replaced virus autorun file with empty autorun.inf file. You don’t have virus now.

Latest version of Windows will not overwrite the existing file, instead it creates file with file name autorun(2).inf.

Method 2 : Remove autorun virus by using command prompt

It is the best method to remove any type of virus including autorun.inf file.

Insert pen drive in to usb slot. Just go to my computer and note down your pen drive’s drive letter (C or D or E or F or G). Just see below screenshot, here ‘G’ drive is my pen drive’s drive letter.


Run command prompt as administrator. You can see How to run cmd as admin in windows 8 and windows 10. For older version of Windows, follow below procedure.

Go to start -> Go to Run -> Type cmd and hit OK -> Right click on Command Prompt and select “Run as Administrator. You will see command prompt window. Type,

Type G: and press enter

Type attrib -h -s -r -a *.* and press enter


This command removes hidden, system, read only and archiv attribute from all the files in ‘G’ drive. You can also use attrib -h -s -r -a autorun.inf to remove those attributes only from autorun.inf file.

Now type del autorun.inf and press enter it will delete the file. You can also manually delete the autorun file.


If you get any problem in this method, you can try the next method.

Method 3 : Delete autorun file in safe mode

Some times you may get “access denied” error after trying “attrib” command.


To solve this problem, just restart your system in safe mode. If you don’t know how to start system in safe mode,

Open your pen drive. Delete the autorun file. You can easily delete the file in safe mode. If you can not delete the file. Right click on autorun.inf file -> Click “Properties” -> Go to “Security” -> and Edit access permissions to “EVERYONE”.

Now restart your PC in normal mode and apply attrib and del command shows that in method 2.

Still if you see problem, then go for next step.

Method 4 : Use winrar and sdformatter

Open your pen drive with winrar. Copy all files from pen drive to your computer by leaving autorun.inf in the pen drive. Format the pen drive. You can use sdformatter to format pen drive instead window format option. Because this software even clears virus from your pen drive.

Leave a Reply

Your email address will not be published. Required fields are marked *