************** Create a cd that will autorun
To create a cd that will auto run create the file ‘AUTORUN.INF’ in the cd’s root directory. This is a simple text file (so use notepad to edit it).
The ‘AUTORUN.INF’ file must start with the following line:
[autorun]
It can then include any of the following commands, each of which is optional:
icon=icon.ico
Specifies the name of the icon file that will be used by explorer as the icon for that cd.
This may be the name of an executable file that contains an icon. If the executable contains more than one icon then an optional index field can be specified to indicate which icon to use: icon=iconfile,index
label=text
label Text label that will be displayed against the cd within explorer.
open=exefile
Specifies the command that is to be autorun when the cd is first inserted. It may include a path and any arguments.
ShellExecute=datafile
Specifies an application or data file that is to be opened. Windows will launch the application associated with that file type to open the datafile.
Note: ShellExecute is not supported under all versions of Windows (e.g Window 98).
For example to create a cd that will autorun the program ‘setup.exe’ would require an AUTORUN.INF file similar to:
[autorun]
open=setup.exe
icon=setup.exe
To create a cd that will autorun to open the html file ‘index.htm’ would require:
[autorun]
ShellExecute=index.htm
icon=index.htm
However, since not all versions of Windows support ‘ShellExecute’ a less elegant alternative would be:
[autorun]
open=command /c start index.htm
icon=index.htm
Be aware that the use of ‘command’ and ‘start’ restrict this to machines running Windows.
________________________________________________________________________
************** Test cd autorun without burning a cd
When producing a cd that will autorun the easiest way to test whether the contents of the autorun.inf file are correct is to blow a cd and try it. There are a few methods that allow you to test the cd autorun without burning a new cd:
Autorun subst drive (not XP)
The DOS command 'subst' allows a path to be assigned to a drive letter. To use this command open up a new 'command prompt' (either use start > run and enter 'cmd', or run find it under the Programs menu).
Assuming that the cd image that you wish to test is in the folder 'C:\MyThings\MyCD' then (in the command prompt) type:
subst T: C:\MyThings\MyCD
This will associate the drive letter 'T' with the folder 'C:\MyThings\MyCD'. (Any free drive letter can be used, it does not have to be 'T'.) Within windows explorer the 'T' drive will now be listed, whilst it will not automatically run the autorun file by right clicking the drive within explorer the option should be available to 'AutoPlay'. If the option is not available then check that there is an 'autorun.inf' file in the folder and that it is correctly structured.
One thing to note about this mechanism is that Windows appears to cache information about the autorun settings. If you then edit the 'autorun.inf' file delete the drive substitution and recreate it before testing you changes. For example:
subst T: /d
subst T: C:\MyThings\MyCD
Otherwise you may find that windows does not pick your changes up.
Note: This has been tested under Windows 98 and Windows 2000. It does not appear to work under Windows XP.