| The
registry settings determine whether or not autoplay is enabled
for specified devices.
The
autorun.inf file
At
its most simple the autorun.inf
file can contain just a reference to the icon which is displayed
against the disc in Windows Explorer. In this instance the
content of the file would be
[autorun]
ICON=smile.ico
The
name of the icon can refer to any valid icon graphic. Notice
that - in Windows - the case of text in autorun.inf
is irrelevant.
If
you want to add options to the pop-up menu which appears when
the CD icon is right-clicked, options can be added by inserting
pairs of rows to autorun.inf,
the first line specifying the text which will be displayed
and the second the action Windows should take. In the example
below we need the menu item to read Instal printer test
and the action to take is to install our printer test program
from the CD.
[autorun]
ICON=smile.ico
shell\mylabel Instal printer test
shell\mylabel\command setup.exe
Finally,
in the simple case, there is the small matter of what will
be autoplayed. Quite a lot has been written about autorun's
inability to transparently handle HTML files. It should be
as easy as including
file=StartUp.html
or
something similar in autorun.inf.
But, if you've ever tried it, you'll have noticed that this
doesn't work.
There
have been a number of ways of getting round this shortcoming.
Most rely on reading Windows' configuration from its registry
and working with a known browser returned from the HKEY_CLASSES_ROOT\HTTP\shell\open\command
registry entry. Beware, however, that not all browsers stick
with the conventions used by IE and Netscape, if you're inclined
to write your own launch software. There are a number of ready-written
programs available which allow you to run them with the name
of the HTML file passed as a command line argument, as in
runHTML.exe
StartUp.htm |