The autorun.inf file is a disk or configuration information file most commonly found on removable disk drives.. Gives Windows AutoPlay and AutoRun functions the ability to work with the removable disk drive, and it must be located in the root folder of the removable drive for it to work. Please note that you will not be able to view the autorun.inf file unless you have checked the box “Show hidden files and folders” in folder attributes.
In case you get a message saying “Access denied” every time you try to remove or modify the file in any way, there are two things that could have happened. One of them is that an antivirus program has placed a protection on the file to prevent a virus from infecting it and replacing the commands with its own, and the other is that a virus has effectively infected the file and does not allow you to do anything. with the.
Whatever the case, there are solutions that allow you to remove the corrupt autorun.inf file, and you don't have to worry, since the removable drive will create a new one the next time you plug it in. The first method works if an antivirus has altered the file, but if that doesn't work, continue with the other methods that show how to remove the file even if a virus denies you access.
Method 1: copy your data and format the drive
If an antivirus has protected the file, the procedure to get rid of it is quite simple. Open your disk and select all the data you have on it, and he does not want to lose them. Copy them to another location on the desktop, since they will be permanently removed from the drive. Once you have finished copying them (the time required will vary depending on how much data you have and the speeds the drive is running), open My Computer or This Computer, depending on the version of Windows you are using. Find the drive in question and right click on it. You will find a Format option in the drop-down menu, click on it. In the window that opens, click the start button and wait for it to finish. Make sure it is the correct drive and that you have copied all the necessary data elsewhere on your desktop, since this program will erase everything on the drive you run it on. Once this is done, you can copy your files back to the drive and continue using it as usual. If this doesn't delete the file, you are most likely infected with a virus, so keep reading to fix the problem.
Method 2: take ownership of the file and delete it later
This method will require the use of an elevated command prompt, which can be quite a powerful tool in situations like this. To open it, press the windows button or click the start button on the taskbar and type cmd in the search box. Right-click on the cmd application that appears in the results and select Run as administrator from the drop-down menu. Once inside, you must write the following command:
takeown /f F:autorun.inf
Make sure you don't make a mistake when writing, and if the F: It is not the unit of the letter that you intend to take care of, replace the letter with the one that corresponds. You can see the lyrics in My Computer / This PC. Once you have ownership of the autorun.inf file, you can open your removable drive and delete it.
Method 3: start Windows in safe mode and delete the file
Booting Windows in safe mode will allow you to do more advanced things than a normal boot, and also blocks a number of services that could be the cause of your problems. Booting into safe mode is pretty straightforward.
For Windows 7 / Vista
The first thing to do is shut down or restart your computer. When i turn it on, or turns on after reboot, press F8 a few times before Windows starts. Use the arrow keys to highlight Safe Mode and press Enter. Once you are inside Windows, you can navigate to your removable memory drive and remove the autorun.inf file.
For Windows 8/10: see the steps (here)
Method 4: delete the file directly via a command prompt and scan the computer
With this method you don't need an elevated command, a normal one will work fine. You can open it by simultaneously pressing Windows and R on your keyboard, typing cmd in the search box and hitting Enter. Once inside, enter the following commands and hit Enter after each one:
cd F: o cd "whatever the drive path is" attrib -r -h -s autorun.inf of autorun.inf
Make sure not to confuse the spelling, including spaces in attrib command. When it's over, reboot the system and the problem will be fixed. Despite this, most likely the cause of the problem is still in the computer, therefore be sure to run a full system scan with an antivirus program to clean the system of any threats that may be inside.
Method 5: use Diskpart to absolutely clean the drive
NOTE: BE CAREFUL WITH THIS METHOD – DO ONLY IF YOU CAN UNDERSTAND THE METHOD. YOUR C UNIT MAY ERROR: OR ROOT IF YOU DO IT INCORRECTLY. IN ANY CASE, MAKE SURE YOU HAVE A BACKUP COPY OF ALL YOUR DATA.
This is another method that erases everything on your disk, therefore be sure to copy your data beforehand. You can use the clean or clean all commands; the second is more thorough but takes more time and you don't want to use it many times, as it shortens the life of the unit. The first step is to open an elevated command. You can see how to do it in the Method 2 of this guide. When i'm inside, type diskpart and hit Enter.
In this point, you need to know the correct number of the hard drive you are working with. This can be easily done by pressing Windows and R simultaneously, and typing compmgmt.msc, and then pressing Enter (click Yes if you receive a UAC message). Select Disk Management in the left pane and note the number of the disk you want to clean.
Go back to the disk part, type disk list and hit Enter. This gives you a list of all the drives connected to the computer, and you will have to choose the one you need according to the number. As an example, if it is the disk 1, do it by typing choose disk 1 and pressing Enter. In the listing, see if the status of that disk is Online or Offline. If you are offline, use disk online command to bring it online. With the disk now selected, type clean or clean all, depending on the command you want to go with. When it's over, type exit and hit Enter, and then close the elevated command prompt.
Since the disk will now show as unallocated space, you will have to create a new partition. To do this, right-click on the drive in question in the previously opened disk management window. Click New Simple Volume in the menu and follow the wizard to create a new partition. Once this is done, your disk can be used once more.
Access Denied message when working with autorun.inf can annoy many users, despite this, the solutions are simple and, using the previously mentioned methods, will get rid of it in no time.






