okay, guys please help me :)
i am using windows 7, panda antivirus, MBAM, usb disk security.
there is an autorun.inf in my usb flash drive.
usually this is not a problem because i use USB Disc Security to save me from those autorun.inf from my flash drive, but i failed to delete it.

so, i opened the usb flash drive and i see that autorun.inf is hidden.
i tried using command prompt at the usb flash drive.

G:\>attrib -s -h *.* /s /d

and i got this

access denied - G:\AUTORUN.INF

i got pissed off because usually it works, and after that i will rename the file to ".vir" or anything else and delete it after i restart my computer.
so i tried using this software "unlocker"
it says that the item cannot be removed, do you want to delete it on the next reboot, i clicked yes, i restart my computer then my computer hangs at the start window (windows logo, black background) so i did a hard shutdown(hold the on button few seconds till it is off). but when i on my laptop again, it runs as usual.

i want to know is there any way to delete this Autorun.inf ?
usually this "attrib -s -h *.* /s /d" and "rename and delete" usually works, but it seems viruses are advance than me. :S

Dani AI

Generated

— good troubleshooting so far (attrib + Unlocker); and offered useful tools but this looks like a classic “file locked / permission / readonly” problem rather than a stubborn mystery file. Short, practical plan below: try to identify what’s holding the file, remove any handle or take ownership, and if that fails reformat the stick from outside Windows. Back up anything you need first (scan those files before you reuse the drive).

  1. Check for a process holding the file
  • Run Process Explorer as Administrator and use Find → “Find Handle or DLL” to search for autorun.inf; that will show the process keeping the file open so you can close or kill it. You can also use the command-line Handle utility to list/close handles. (learn.microsoft.com)
  1. If it’s a permission/ownership issue
  • Open an elevated command prompt, take ownership of the single file, grant yourself full control, then delete it. Example sequence (replace G: with your drive letter):
takeown /f G:\autorun.inf
icacls G:\autorun.inf /grant %USERNAME%:F
del /f /q "G:\autorun.inf"

Those two commands recover ownership and reset ACLs so deletion is possible. (learn.microsoft.com)

  1. If the USB is read-only or still resists deletion
  • Use DiskPart (run as Admin) to clear a read-only attribute or, if acceptable, wipe and recreate the partition. Typical DiskPart steps: list disk → select disk X → attributes disk clear readonly → clean → create partition primary → format … (this erases the stick). Always confirm the disk number before running destructive commands. (learn.microsoft.com)
  1. Other fallbacks and cautions
  • If Windows still can’t remove the file, boot the PC from a Linux/GParted live USB (or use a rescue disk) and delete or reformat the stick from that environment — it bypasses Windows locks and is often the simplest solution. If autorun.inf reappears after a format, the host machine is reinfecting the drive and needs a full offline scan (rescue disk) before you reuse any removable media. (gparted.org)

If steps 1–3 don’t work, say which step failed and paste the exact error text; that narrows the cause (locked handle vs. hardware write-protect vs. firmware/rootkit).

Recommended Answers

All 4 Replies

Haven't used this but you might try this;

i tried autorun eater, still no luck. autorun.inf is still there.

well, here i attach a screenshot when i try to delete is directly.
maybe the file is superhidden, or the attributes is more priority than system files. :-/

According to the link below "Microsoft has removed the autorun.inf feature from Windows 7. This means that when you insert the USB drive, the programs will not automatically start up."

http://www.addictivetips.com/windows-tips/autorun-inf-does-not-work-in-windows-7-anymore/

Also see this link http://blogs.technet.com/srd/archive/2009/04/28/autorun-changes-in-windows-7.aspx
"AutoPlay will no longer support the AutoRun functionality for non-optical removable media. In other words, AutoPlay will still work for CD/DVDs but it will no longer work for USB drives."

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.