This article is from the CD-Recordable FAQ, by Andy McFadden (fadden@fadden.com) with numerous contributions by others.
(2002/10/15)
The "autorun" feature of Windows 95 and later allows a program to be executed
right after a CD-ROM is inserted. For this to work, the system must have
autorun enabled, and Auto Insert Notification ("AIN") must be turned on
for the CD-ROM drive. See section (4-1-1) for more information on AIN and
the use of "TweakUI" to modify settings. It may also be necessary, in some
configurations, to close the last session on the disc, or AIN will not work.
When preparing a CD-ROM for Windows, put a text file called "autorun.inf"
in the root directory that contains something like this:
[autorun]
open=filename.exe
icon=someicon.ico
When inserted, the CD-ROM will be shown in the "My Computer" window with
the specified icon. If the disc is inserted on a system with AIN and
autorun enabled, the program named on the "open" line will be launched.
Icons must be in Windows icon or bitmap format. You can't use a GIF
or JPEG. Make it square, 32x32 pixels. If you're going to be doing
a lot of these, you may want to try Axialis "IconWorkshop", from
http://www.axialis.com/axicons/.
There doesn't appear to be a way to specify custom icons for individual
folders.
Incidentally, the "root" directory is the top level of the disc, e.g. "D:\".
(If you viewed a directory hierarchy as a tree growing upward, the topmost
directory would be at the root of the tree.)
Here's a more complicated example:
[autorun] open = setup.exe /i icon = setup.exe, 1 shell\configure = &Configure... shell\configure\command = setup.exe /c shell\install = &Install... shell\install\command = setup.exe /i shell\readme = &Read Me shell\readme\command = notepad help\readme.txt shell\help = &Help shell\help\command = winhlp32 help\helpfile.hlp
 
Continue to: