CD Autorun HTML File

How to make a CD automatically open
a HTML file, or any other file

Making a CD start a program automatically when it is inserted into a Windows PC is easy!

A CD in the hand

Background: autorun.inf

When a CD is inserted into a PC, Windows looks for a file called autorun.inf. This file can contain many options, but at its simplest it just tells Windows to run a command, as in the example below:

[autorun]
open=program.exe

In this example, the autorun.inf file is just telling Windows to run the program program.exe.

You can insert any command you like into this file, and once the requested command is in the PATH environment variable, it will run.

A working example: opening a HTML file.

In order to open a data file, such as a HTML file, automatically, the autorun.inf needs to call the Windows Start command. Running a command such as start index.html should run the application associated with HTML files and open index.html within that application. You would think that a simple autorun.inf like this would do the trick:

[autorun]
open=start index.html

However, this doesn't seem to work in most cases. So we have developed a really simple application that passes on your requested parameters to Windows, and can be used to start any program when a CD is inserted. This simple, free program, called RunCmd can be downloaded using this link:

Download RunCmd.Zip here.

Once you have downloaded the tiny Zip file (4Kb), unpack the tiny executable file (7Kb) and place it in the root of your CD file structure when you are burning your CD.

Then, to get that CD to automatically open a HTML file, you need to copy the autorun.inf to the root folder of the CD, alongside the RunCmd.exe. This autorun.inf file should contain the command to tell RunCmd.exe to open the HTML file:

[autorun]
open=RunCmd.exe start index.html

You can change the text index.html in the autorun.inf file to the name of the file you want to open automatically, including its relative path if it is not in the root folder.

This will then automatically open the required file when the CD is inserted into a Windows PC.

I hope this tip is of use to you!

Please note, that this file is provided as is, with no warantee or licence whatsoever. By downloading the RunCmd.exe program, you are accepting that the author and maintainer of this web site are not responsible for how you use the file or for any damage, accidental or otherwise that it might cause.

The RunCmd.exe utility is an extremely simple, ANSI C program of about 30 lines. If you don't trust the ZIP file download, and can compile C code, then here is the source code (C File).