lotus

previous page: 3-21] How do I automatically launch something? Change the CD icon?
  
page up: CD-Recordable FAQ
  
next page: 3-21-2] How do I launch a document (like a web page)?

3-21-1] How does Windows "autorun" work?




Description

This article is from the CD-Recordable FAQ, by Andy McFadden (fadden@fadden.com) with numerous contributions by others.

3-21-1] How does Windows "autorun" work?

(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

Taking it line by line, this says:
- The default AutoRun command will be "setup /i"
- The icon for the CD will be icon #1 embedded in setup.exe

- Four commands will be added to the right-click pop-up menu:
'Configure...',
which will run "setup /c"
'Install...',
which will run "setup /i" (same as auto-run in this case)
'Read Me',
which launches notepad.exe to display "help\readme.txt"
'Help',
which displays the file "help\helpfile.hlp" with the Win95 help facility

You can test the autorun features of a disc without recording one. If you
SUBST a folder onto a drive letter, the autorun feature will scan the new
drive. For example, from a DOS prompt, enter "SUBST J: \goodies\NewCD".
This technique is also useful for testing out a CD-ROM you're preparing.

If you'd rather not have to deal with all this, try one of the applications
listed in section (3-21-3).


 

Continue to:













TOP
previous page: 3-21] How do I automatically launch something? Change the CD icon?
  
page up: CD-Recordable FAQ
  
next page: 3-21-2] How do I launch a document (like a web page)?