How to remove autorun.inf virus , open hidden

adel - Feb 2, 2009 at 08:00 AM
 vaaji - Oct 2, 2012 at 06:17 AM

seems like I am infected with an autorun.inf virus. Could you help me to remove it ?

13 replies

Hi every body

If your computer is not infected with (autorun.inf) and all the drivers are clean ,Then you can remove the autorun from your USB for example or another memory storage device by :

1- You can use this simple way

- First,insert your flash memory in the port(while pressing left shift at
the sametime to avoid the autorun).

- Now you can use winrar program to explore your flash will find
autorun and another hidden viruses such as xcopy,Recycler,and so on
select them and press delete from the keyboard.

- Eject your flash memory and insert it again by the same way to make sure
that all the viruses and the autorun have been removed.

2- Another way visit kaspersky website you will find a free tool that is used to
remove the virus that damage the exe files as well as the autorun download it
to your disktop with no need to download all the kasper anti-virus and scan
your PC or the flash..etc

waiting for Reply

hi,, I hav a prblem regardng to autorun.inf... u see in my usB a have 3 folders that has specific files... now there gone??? is this because of the autorun???? how shall I make the 3folders appear????????? plssss help me........ I beg you ... those files are very important........... thnx in advnce......
u r soooo brilliant thank you sooooo much I got new flash drive and it had autorun.inf and with ur steps I deleted it
Thanks for your advice

Please tell me which virus removal tool to download from kaspersky site to remove recycler virus
@ Felix, very successful command and it works very well.
It really helpful. Thanks
@ Prince, The command is helpful.... Thank you.
Pasan Indeewara
Mar 17, 2009 at 04:49 AM
There is a much simple way to remove the Autorun.inf file. Genreally when you refresh the windows explorer view a bounded virus process recreates this file. This file is attached to many events of windows explorer including OPEN, REFRESH, etc. Simple stept to remove the virus activation:
You must close opened explorer windows.

1. open up a command prompt (i.e. cmd.exe) >> to load it go to Run, type cmd, enter.
2. Now to remove virus's attributes (in order to delete it type following line by line and execute them pressing enter.
F:\attrib -s -r -h *.* If there are any malicious EXE files those are now visible so if unnecessary delete them too.
F:\del autorun.inf

3. After finishing above, quickly remove the pen as soon as posible (just after executing del command).
4. Now your pen is without virus activation config. file. Now you can safely delete unnecessary EXE files on it.
to get rid of Autorun.inf related viruses do the following in all of your removable and local drives.
if autorun.inf already exists then,
open cmd (command prompt) and change the directory to the root of (infected) drive,
i.e C:\ has autorun.inf
C:\>del /a:rhs c:\autorun.inf | md c:\autorun.inf
this will remove autorun.inf file and will create autorun.inf directory which will prohibit viruses from creating autorun.inf files in same drive.
repeat the process for all drives.
you can also create files named Recycle, Recycler, Restore, System etc in all drive to prohibit creation of folders having these names (thoese folders are created by viruses to complete their process in every drive)
and you can also create directories of same name that of virus file i.e fbak.exe, fix.exe, sscvihhost.exe, system.exe, etc
i got the message could not find c:\autorun.inf when I typed the command given by u.... wat does it mean????
Thanks for the info on how to remove the autoplay problem from my USB. A virus/worm, elondon.exe created an autorun.inf file on my USB which I have now deleted. I also created the autorun.inf folder on the USB to prevent this virus from doing it again!
if you had autorun.inf

you must follow this steps
  • 1. open run run dos command
  • 2. select the drive eg. D:/ o F:/
  • 3. type this word eg: d:\> attrib -r -a -s -h autorun.inf
  • 4:then type delete for typing = del autorun.inf

if you use flash disk just remove it then connect again.

Didn't find the answer you are looking for?

Ask a question
Hello Friends,

i got one solution yesterday.

Step 1:

Create .bat file like "KillAutorun.bat" paste below code to bat file.

attrib -r autorun.inf
del autorun.inf
md autorun.inf
attrib +r +h autorun.inf

Step 2:

Creating .reg File "Dissable_auto_run.reg" to stop windows Auto run.




Step 3:

Palce both files (Dissable_auto_run.reg and KillAutorun.bat) in USB root.

Execute(doubble Click) KillAutorun.bat

Step 4:

Assume USB drive id is "I:"

Open I:\RECYCLER\S-1-5-21-1482476501-3352491937-682996330-1013\

in this folder will have some exe file Eg: myslides.exe

Create one batch file same as Step 1.

Eg: Create .bat file like "KillAutorun.bat" paste below code to bat file.

attrib -r myslides.exe
del myslides.exe
md myslides.exe
attrib +r +h myslides.exe

Run this bat file from "I:\RECYCLER\S-1-5-21-1482476501-3352491937-682996330-1013\"

Note: S-1-5-21-1482476501-3352491937-682996330-1013 this folder name will differ from one system to another system.

Thanks and Regards
Rajesh Natarajan MCDBA
Registration date
Monday February 1, 2010
Last seen
September 1, 2021
Jun 5, 2010 at 05:21 AM
This is the standard procedure to delete the Autorun.inf file

Normally when a virus infects a windows system which causes a drive opening problem, it automatically creates a file named autorun.inf in the root directory of each drive.

This autorun.inf file is a read only ,hidden and a system file and the folder option is also disabled by the virus. This is deliberately done by the virus in order to protect itself. autorun.inf initiates all the activities that the virus performs when you try to open any drive.

You have to just delete this file and restart your system to correct this problem.

Follow the set of commands below to show and delete the autorun.inf

1. Go to Start then Run and type cmd and press enter. This will open a command prompt window. On this command prompt window type the following steps.

2. type cd\ press enter

3. type attrib -r -h -s autorun.inf press enter
please note the spacing: no space between the dash and the letter & a space after the r h and s

4. type del autorun.inf press enter
if the PC returns a "file not found" message - check the spelling for autorun.inf

5. if you have a d drive: type d: and press enter for d: drive partition. Now repeat steps 3 and 4. Similarly repeat step 5 for all your hard disk partition.

Restart your system and your trouble will be fixed. Except the program that caused the problem is still in your computer.

Make sure you are connected to the Internet. and download Malwarebytes' Anti-Malware program.
Double-click on Download_mbam-setup.exe to install the application.
When the installation begins, follow the prompts and do not make any changes to default settings.
When installation has finished, make sure you leave both of these checked:
Update Malwarebytes' Anti-Malware
Launch Malwarebytes' Anti-Malware
Then click Finish. MBAM will automatically start and you will be asked to update the program
before performing a scan. If an update is found, the program will automatically update itself.
Press the OK button to close that box and continue.

On the Scanner tab:
Make sure the "Perform Quick Scan" option is selected. Then click on the Scan button.
The next screen will ask you to select the drives to scan. Leave all the drives selected
and click on the Start Scan button. The scan will begin and "Scan in progress" will show at the
top. It may take some time to complete so please be patient. When the scan is finished, a message
box will say "The scan completed successfully. Click 'Show Results' to display all objects found".
Click OK to close the message box and continue with the removal process. Back at the main Scanner
screen, click on the Show Results button to see a list of any malware that was found. Make sure
that everything is checked, and click Remove Selected. When removal is completed, a log report
will open in Notepad and you may be prompted to restart your computer. (see Note below) The log
is automatically saved and can be viewed by clicking the Logs tab in MBAM.
If MBAM encounters a file that is difficult to remove, you will be presented with 1 of 2 prompts.
Click OK to either and let MBAM proceed with the disinfection process.
If asked to restart the computer, please do so immediately.
Failure to reboot will prevent MBAM from removing all the malware.
similar to what daz said...

im doing an IT networking course and I grabbed a batch file from tafe that clears the autorun.if

its pretty helpful for getting rid of the autorun.inf files which go around a lot at tafe because of all the students with usb's

anyways... copy and paste the following code (in between the ---) into notepad and save it as ClearInf.bat

rem @echo off 
echo Copy this file to the top level of the disk or USB from
echo which you want to remove the Autorun, then run it
echo press Ctr C to stop now, or Enter to continue

attrib -r -s -h Recycle /s /d
attrib -r -s -h autorun.inf
attrib -r -s -h /d /s "Recycle\P-1-3-64-8794238531-8742492-9897532"

del autorun.inf /q

and as the note says, put the bat file in the root level of your usb.
Run cmd & Enter the ff.

del /a:h /f (drive):\autorun.*

for example:

del /a:h /f c:\autorun.*

Follow the set of commands below to show and delete the autorun.inf

1. Open Start>>Run and type cmd and press enter. This will open a command prompt window. On this command prompt window type the following steps.

2. type cd\

3. type attrib -r -h -s autorun.inf

4. type del autorun.inf

5. now type d: and press enter for d: drive partition. Now repeat steps 3 and 4. Similarly repeat step 5 for all your hard disk partition.

Restart your system and your trouble will be fixed.
Restart PC. Press F8 during restart(or whatever button gets you to safe mode), enter in safe mode with command promt, after drivers and system files are loaded the command promt pop up. You can check your usb drive by typing "dir [yourdriveletter]:" and if you see autorun.inf then thats the file you have to delete. Type "del yourdriveletter:\autorun.inf". For example my drive letter is "i". I type " del i:\autorun.inf ". Problem solved.
the best and easiest way to do it is as follows:

open cmd

the type in the drive name e.g. G:

then type in autorun.inf

now the autorun.inf file will open, select all the text and delete then go to file and select save.

done. (NOTE: if it is a usb drive then just take it out and put it back in. however if it your computer hard drive then you might have to restart your computer)

HOPE THIS HELPS!!!!!!!!!!!!!!!!!!! :D
This can't do much as the virus simple overwrites itself over the new autorun.inf file you have just created. The only way is to make a new directory named autorun.inf.
hi guys,
here is a guide to get rid of the malicious wares in your flash drives:

- insert your flash in a non-infected PC
-go to start, all programs, accessory and open the command prompt
-in the command prompt, change to your drive letter for example :
if (f) is your drive letter, then the syntax should look like that. Or better still do this:
c:\format f:
-your flash drive will be formatted getting rid of all the malicious wares
-change to your drive letter e.g c:\f:
- at the f:\, type dir to verify all files have been deleted.
-close the prompt window and safely eject your flash drive.
Dear Kingdavid,
I found the "Autorun.inf" worm on my C:\ drive and executed your command, and rebooted.
Running virus scan again indicated that it was still there (I have no other drive installed other than the CD drive, which is clean).

Any other ideas?

-- Jonathan