Monthly Archives:: February 2009

How to disable autorun of USB disks

Posted by & filed under .Net, .Net 3.0 / 3.5, Visual Studio, Win 32 API, Windows Forms.

The autorun.inf file helps to start / execute applications while inserting USB drives. You can disable this behavior using WIN32 API. Here is the implementation. By overriding WndProc() method, application can receive the global or system wide messages from Windows.