How to create an autorun CD

When a CD is inserted into a PC computer, Windows presents the user with several options on how the disc should be opened. This can include 'exploring' the disc contents or playing the disc in WMP (windows media player).

A more user friendly approach to handling data discs in windows is to author the disc so that it automatically runs the desired software, or launches a specific file in a designated program, An example of this would be a PDF file into Adobe Reader. By creating a CD with this functionality it saves time and effort for the user from exploring the contents of the disc in order to find the correct files to run. A disc with this type of functionality is known as an autorun CD, it looks very professional for the final user, is fairly straightforward to implement, and can be done using existing tools within the windows or mac environment.

An auto run CD is also useful when the end user is likely not to be that computer literate to navigate to the right parts of the disc manually.

There are two main types of autorun file that we can create. One is known as the 'open' autorun, the other being the 'shellexecute' autorun. The 'open' autorun is used when a specific executable files needs to be run from the CD. An executable file can be identified from the .exe extension to the end of the file name. The 'shellexecute' is used when we need to open a specific file in its native software that is already pre-installed onto the computer.

For example, if we wanted the user's computer to open a particular software on the CD, then we use the 'open' method, and if we wanted to open say a PDF file from the CD, then we'd use the 'shell execute' method by using the script to launch Adobe reader, and then open the PDF file in Adobe Reader.

To create the autorun file, we will use Notepad, which is pre-installed on all windows machines.

Create an autorun with the 'open' command

The first thing to do is fire up notepad. Then we write '[autorun]' on the first line. On the second line we write, 'open=filename.exe' (where file name is replaced with the name of the software). We then save the file using the name, 'autorun.inf'.

Create an autorun with 'shellexecute' command

Again fire up notepad, and as above the first line contains, '[autorun]'. Then the second line contains, 'shellexecute=filename.extension', where 'filename' is the name of the file, and '.extension' is the extension of the file, using the above example of a pdf file, the file could be discwizards.pdf.

As in the 'open' method, we save the file named as 'autorun.inf'.

Important information about the above instructions: Do not type the apostrophes, only the content within them. If your filenames have spaces in the naming convention, then for the purposes of the autorun, (which cannot recognise files names with spaces), either lose the spaces or replace the spaces with underscores in the original files.

The autorun file will reside on the root of the disc. If you need the auto run to launch a file which is stored deeper within another folder, then we can reference this file, by using the foldername before the filename, therefore, nameoffolder/filename.extension.

A point to remember is those users who are extra security conscious may have disabled the ability for CDs to launch without any user input, and therefore the autorun.inf file would not work in this case, however, they are likely to be experienced users, who would be comfortable with navigating the disc contents themselves, and are likely to find the correct content of the disc themselves. It is also worth putting instructions on the CD packaging or the print on the disc, informing users that an autorun is present on the disc, but also provide instructions on how to operate the disc, in case the auto run does not launch.

Added bonus, include a customised icon and label for your autorun CDs

If you have managed to follow the above instructions without a hitch, then additional functionality we can encode in the autorun is to display a custom icon in Windows explorer for your CD, and the label can give it a unique name rather than the default windows naming convention. This can be a company logo, or other graphics related to the contents of the disc, and text title describing the disc content.

To include the customised icon, first create a 30 pixel by 30 pixel icon. This can be done in MS paint, or if you have paid software such as Photoshop, than this can be used too. Save this file with a .ico extension. Then in the autorun.inf file, we add the following line to the bottom, 'icon=filename.ico', and the label for the disc, can be handled by adding, 'label=MyCDName', where MyCDName is replaced with a descriptive name for the content of the disc. Remember to put both these commands on their own new lines, and do not include the apostrophes.

Finally we ensure the autorun.inf file is placed in the root or top-most folder of the CD contents, and do make sure to include this file when creating the master CD.

As a final note, check the disc works as intended by testing it in various computers, before sending it across to Disc Wizards, or any other CD duplication manufacturer for mass pressing.

Note for Mac and OSX users

Autoruns discs are not easy to create in OSX. Apple has disabled any direct autorun facility within the OSX environment, therefore it is next to impossible to implement unless we use heavy handed hacks, (not recommended). An alternative is to create a custom Finder window design that makes it clear to the user on how to use the disc. There are several paid applications that can create this, as well as using the inbuilt disc utilities within the OSX environment.

If you have any questions about CD authoring, or autorun enquiries, you can email or call us on the above telephone numbers. We'll be happy to assist you with your enquiry and answer any questions you have.

autorun.inf in Notepad with open method.

Fig 1: Above image shows the 'open' method for an autorun.inf file, which is used to launch exe files. It has been created using Notepad.

autorun.inf with shellexecute method using Notepad.

Fig 2: Again we see an autorun.inf file, this time using the 'Shell Execute' method to launch a non executable file, such as a pdf.