# Accidentally deleted autorun.inf how to restore it?



## HiTom (Jul 27, 2011)

I just accidently deleted autorun.inf from my pen drive, now everytime i try to open it i get the error window popping up all the time "F:\ Application not found." What am i supposed to do? Thanks


----------



## spunk.funk (May 13, 2010)

With the USB drive plugged in, go to Start/Search and type *chkdsk F: /R* and press enter. Now type a *Y* to unmount the drive. Check Disk will try and fix any file errors. You should be able to then explore the drive.


----------



## HiTom (Jul 27, 2011)

Didnt work


----------



## spunk.funk (May 13, 2010)

What is on the Drive? Why is there an Autorun file on there? Can you right click the drive and choose Explore? If so, copy the data off of the drive and then format the Drive, then restore the data.


----------



## HiTom (Jul 27, 2011)

spunk.funk said:


> What is on the Drive? Why is there an Autorun file on there? Can you right click the drive and choose Explore? If so, copy the data off of the drive and then format the Drive, then restore the data.



Already formatted it, didnt work :S 

And no there isnt any Autorun file since i formatted it, and i can assure you there wasnt any atuorun file before just the one that i knew called "Autorun.inf" or something, but that is gone, and also for some strange reasons, i can open it but i have to right click and choose "Open in a new window", but if i simply double click on the F drive then the error msg will automatically pop up, what kind of problem is it? Its really annoying.... help me pleaseee


----------



## spunk.funk (May 13, 2010)

Go to Start/Run and type CMD. In the command prompt and write the following.

*attrib -s -r -h X:\autorun.inf*

press enter and then write

*del X:\autorun.inf*

press enter and after this disconnect usb device from system and reconnect it.

Note: Please notice that X means the drive letter (F:\, G:\, etc).


----------



## HiTom (Jul 27, 2011)

spunk.funk said:


> Go to Start/Run and type CMD. In the command prompt and write the following.
> 
> *attrib -s -r -h X:\autorun.inf*
> 
> ...



Tried that one too, and it says when i enter 

attrib -s -r -h F:\autorun.inf

File not found - F:\autorun.inf



*** is wrong??? :*(


----------



## Jay_JWLH (Apr 30, 2008)

If you just want to access the USB contents, you should be able to right click on it, and click Open. This should ignore any attempts to run the Autorun feature of your USB.

Are you by any chance using a U3 USB? What is the description of the USB device?


----------



## Johnny1982 (Oct 15, 2010)

Disable the Windows Autorun feature, that's what I always do to prevent that pesky popup asking how to open the contents of a CD / DVD or USB Stick. Was the autorun.inf file not perhaps part of a virus?


----------



## HiTom (Jul 27, 2011)

Johnny1982 said:


> Disable the Windows Autorun feature, that's what I always do to prevent that pesky popup asking how to open the contents of a CD / DVD or USB Stick. Was the autorun.inf file not perhaps part of a virus?



Im not sure if it was a virus, and for the type of device, i dont see any description of the pendrive, but i can open it by right click and choose open, thats the only way i can open it, but if i double click it, the error msg will pop up, i will try to disable the windows autorun stuff.


----------



## Jay_JWLH (Apr 30, 2008)

You could always just create a replacement Autorun.inf file using notepad. You can also find some additional information at the following page:
USB Drive AutoRun.inf Tweaking
Then you can set the USB icon, USB name, what the autorun tries to open, and more. So if on the USB there is an icon file, and a setup.exe file or something else it used to start automatically, you can easily recreate it by linking to all of those things. Or.... just leave it empty.


----------



## HiTom (Jul 27, 2011)

I just noticed that, even if there is an autorun.inf file in the pendrive, it still cannot open it, couldn't the problem be that windows cant run the autorun.inf file for some reason?


----------



## Jay_JWLH (Apr 30, 2008)

Does the autorun feature of your pendrive work on another computer? Also give your anti-virus program the opportunity to scan the entire device. What anti-virus program are you using?


----------



## Johnny1982 (Oct 15, 2010)

Where I work we get to print a lot from USB Memory sticks and my Antivirus is set to automatically block the Autorun function of any Memory Stick or CD/DVD and my WinXP's Autorun feature is also disabled, as many viruses manifest themselves in the autorun.inf file and if it autoruns, it transfers the virus file to the PC in an instant, trust me I know it's that quick, had the experience already.


----------



## spunk.funk (May 13, 2010)

Go to Start/Run and type *diskmgmt.msc* and press enter. In the Disk Management window is your Flash Drive still drive *F:* ? If not, change the attrib command accordingly. From here you should be able to right click the drive and choose *Explore*. If the drive is 2GB or smaller, Try formatting the drive *FAT16*. If larger format it *FAT32*.


----------



## HiTom (Jul 27, 2011)

Jay_JWLH said:


> Does the autorun feature of your pendrive work on another computer? Also give your anti-virus program the opportunity to scan the entire device. What anti-virus program are you using?


Yes it works on my laptop perfectly, except on my desktop computer. I also scanned the device with kaspersky internet security 2011 but it didnt find anything.


----------



## HiTom (Jul 27, 2011)

Johnny1982 said:


> Where I work we get to print a lot from USB Memory sticks and my Antivirus is set to automatically block the Autorun function of any Memory Stick or CD/DVD and my WinXP's Autorun feature is also disabled, as many viruses manifest themselves in the autorun.inf file and if it autoruns, it transfers the virus file to the PC in an instant, trust me I know it's that quick, had the experience already.


I leave my AV software off the most of the time, i turn it on when i just scan the PC or a device if i suspect of a virus is on my pc. So its very unlikely it would be my AV doing anything.


----------



## jenae (Jun 17, 2008)

Hi, just read this thread, Seven treats a USB device differently to any earlier OS version, rather then me wear my fingers out:-



> How to launch a program in Windows 7
> 
> In Windows 7 it is not possible to use the ACTION command and the OPEN command together with USB flash drives anymore. Microsoft has removed this support for security reasons. These commands are still available for CDs and DVDs in Windows 7, but not for USB sticks.
> 
> ...


Using AutoRun / AutoPlay with a USB Flash Drive in Windows 7 (SamLogic CD-Menu Creator - Article)


----------



## Johnny1982 (Oct 15, 2010)

HiTom said:


> I leave my AV software off the most of the time, i turn it on when i just scan the PC or a device if i suspect of a virus is on my pc. So its very unlikely it would be my AV doing anything.


This is not a wise move. USB sticks are notorious for virus transfers. My dad had a virus on his pc and just by plugging in my stick in his system the virus transferred to my stick, with an autorun.inf function. Luckily my Antivirus was up to date and blocked the autorun process and removed the virus. Again if your Antivirus has a Guard or Continuous Monitoring function, enable it. The Antivirus software will only remove the Autorun.inf file if it's related to a virus in that Antivirus's Database, if it's not a virus it should/will, depending on virus program, just block the Autorun.inf from executing, just to protect your system in case it has not got record of a possible virus on the USB stick. Everytime I plug a USB drive in my Work's PC and there is a Autorun.inf file on, it gives me a Popup saying that "Autorun.inf was blocked for your safety".

If you have Windows 7 Ultimate or Pro this might help. This does not work if you're running Home or Basic versions of Win 7, as they do not have the Group Policy Editor: 

Disable Auto Play in Windows 7

Click the Start and Input "gpedit.msc" in search box, then click the result to open the gpedit.
Expand Administrative Templates >Windows Components > Autoplay Policies in order.Then double click "Turn off Autoplay"
Click Enabled, and then select All drives so that you can disable Autorun on all drives.Click Ok at last.
After restarting your computer, you have done all the needed work to disable Auto Play in Windows 7.


----------

