Q&A Monday: .html AutoRun CD

Question:

I have created a small (lets call it a web site) and I want to put it on a CD and have it ‘autorun’?

Answer:

Autorun is a feature of the Windows operating systems. Autorun is feature that detects when a CD is inserted and runs an application based on the Autorun.inf file located on the CD itself.

When a CD is inserted into the CD drive, the operating system checks for the file named Autorun.inf in the root directory of the CD (not in a subfolder). This file contains information that tells the computer to run a file.

For most Autorun Cd’s there is an executable file, that will run the CD Program and usually install what it needs.  To Create an AutoRun.inf file for an executable, you would open notepad and type:

[autorun]
open=Filename.exe
icon=Filename.ico

The icon section automatically reads an Icon File (.ico) and places that on the CD’s My Computer image.  The Filename.exe would be replaced with the executable you wanted to run.  The file would then be saved as Autorun.inf and saved in the top directory of the CD ROM (generally that is the D:\ drive) i.e. D:\Autorun.inf

Now when you want to run a CD where a webpage opens up instead of a program, you need to change the code for the Autorun.inf.  You can’t just replace the .exe file with a .htm or .html file and expect it to run, because it just won’t.  You need to use a different command to make the page run.

[autorun]
icon=Filename.ico
ShellExecute=index.html

This will make sure that when the CD autoruns, that it opens the web site for you.

——————————————————————————————–
If  you have any questions that you want Jim to answer, from business servers to home computers, drop him a line at me@jimguckin.com, and he’ll try to answer your question.  Check back every Monday for a new Question and Answer session, and check back during the week for Jim’s other technical insights.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.