Equipment
- I am using Windows 7 Professional.
- I have the Administrator role.
- The USB device has FAT32 file system.
Situation : In the root folder of a USB there is a file called "AUTORUN.INF", which I want to delete, when trying to do it through the Windows explorer, the message appears: "Equipment administrator permissions are required to make changes in this file". I have tried the following alternatives without success.
Proven Alternatives:
- Remove all file attributes (Read Only File, Archive File, System File, Hidden File) via Windows Command Console.
Attrib –r –a –s –h I:/AUTHORUN.INF
Obtaining the following negative result:
Acceso denegado: I:/AUTORUN.INF
- Check which process is using the file with the Process Explorer program and then kill the process with the "Handle V4.0" program as suggested by this solution
Shortcut Ctrl + F, to access the “Handle or DLL substring” functionality, then search for “ I:/AUTORUN.INF
”, it gives me the answer “0 marching items”
- Try the Unlocker program .
I ignored the warning "site suspected of serving unwanted software", I downloaded and installed it, when I right click on the file and then choose Unlocker it shows me that the file is not locked by any process, but it does not allow it to be deleted, it asks do it after the next reboot, but it doesn't remove it in the end either.
Untested Alternatives
- Use a mini Linux, mini Windows or BootCD
Delayed alternative, I don't have those tools.
- Format the USB.
It implies quite delayed data movement.
- Remove it using windows safe mode.
Is there a solution that doesn't involve restarting the computer?
Unlocker is reliable, but I'll show you how to do it with Windows.
For all the options that I show you, open the console in administrator mode, right click on the icon and select the "Run as administrator"
And before anything check the integrity of the file system
If it doesn't work for you, do a full system check.
Option 1
Execute these commands, it may be necessary to "kill"
explorer.exe
to be able to delete the file (explorer may have locked it), and it is used/F
to be able to delete it even if it is read-only.Option 2
The scenario can be more adverse if an executable has locked the file, in that case download this tool from Microsoft and run the following also as administrator.
Handle
Now if then you kill the processes using the pid and
taskkill
Option 3
You may flat out don't have permission, it seems your case, so take ownership of the file:
And then assign the delete permission.
For now if delete
It appears that Panda USB Vaccine has been applied to the drive.
This tool, to prevent viruses from being able to use a
autorun.inf
to run from the floppy or usb, allows you to create (or automatically creates for all drives that are inserted) an autorun.inferróneo
(if I remember correctly, it included the attributes of system, hidden, volume...), in such a way that although it is shown that the file exists, it is not possible to read, delete or modify the file.If you can't access the file even after rebooting, I'm inclined to go with this option. You can also see if
attrib autorun.inf
it gives any clue about it.The tool itself (it is a free program) allows a unit to be devaccinated .
NOTE: I have placed this answer on top of the other as it clearly addresses the issue in a very different way and is to cover a very specific case.
Option 4: Panda USB Vaccine
It turns out that Panda USB Vaccine makes use of file attributes, BUT undocumented attributes, setting a value to 1 that according to Microsoft documentation should always be 0.
In the file format the last byte after the name represents the permissions like this
If one checks the setting of that BYTE for AUTORUN.INF in a RAW disk editor one finds the
42
hexadecimal value that is equivalent to these bytesIf you look closely, set
Y
to1
, that attribute is reserved and what it does is tell Windows that this file is really a device , so that for Windows this file should not be deleted.So you have to rewrite the file attributes at the file system level, to do that follow these steps:
get a binary disk editor, there are several but i recommend iBored
once installed, run it as administrator and open the usb drive from the tool
once 'open' press
CTRL + F
to searchAUTORUN INF
<<--- EYE WITHOUT THE DOT, WITH SPACE . Pay attention to details, such as using case sensitive to make the search faster, as it could take a long time.Once found, select the file name in the Text Editor, look at the hexa character that follows, which is equivalent to the file attributes (in this case 0x42). 1.Press
Ctrl + Shift + M
to make the disk writable, you may get errors, especially in Windows 10. Ignore the errors by clicking Cancel.42
and replace it with20
what is essentially marking the file as ready for archiving and leaving the other attributes at 0, pressSave
In my case iBored worked , once the file was unlocked I opened it and it only had a few letters inside, no malicious code. I think what this file, placed by a previously removed virus, does is it blocks USB autorun to prevent anything else from running and taking control of the USB.
Have you tried PsExec ?
If the problem is one of permissions, perhaps the file can only be manipulated by the SYSTEM account, and this is where PsExec comes in.
Copy the executable to System32 for example, and then from the command prompt run:
This will open another CMD with SYSTEM privileges; What follows is that you navigate to the file and use some known command such as:
I had the same problem, it wasn't a virus, I just couldn't delete the autorun.inf from the root of the USB.
My solution was to disable the Panda Antivirus USB Vaccine, however, this does not delete the autorun.inf, it does not re-create it with the new memories. Those who already have it must format it. It seems that the autorun.inf is corrupted (by Panda on purpose) and cannot be touched.