As you may already be aware, Autorun is one of the malware infection means in Windows. I have been searching for the best way to disable Autorun that could really give me a peace of mind and have come across this article.

Some background

You can skip this part actually. But if you are interested in some technical details, you can continue reading. This post is written based on Windows XP but it should also work for other NT family of operating systems such as Windows 2000, Windows Vista, etc. Henceforth, any reference to Windows means Windows XP.

In Windows, .ini files are now mapped to the Registry. What really happened is whenever a x.ini file is referenced, it will look up the corresponding x.ini in HKEY_LOCAL_MACHINE\Software\Microsoft\Windows NT\CurrentVersion\IniFileMapping. It seems .inf works in the same way too.

If you read through the Microsoft documentation, you find an interesting symbol “@” used in the value. What it does is it prevents any reads from going to the .ini file on disk if the requested data is not found in the Registry. Now we are all set for the solution.

The solution

Create a Registry file DisableAutorun.reg with the following content and double-click on the newly created file to import the setting. That’s it.

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\IniFileMapping\Autorun.inf]
; Assign a non-existence key to "(Default)".

Excellent References: