How To Create an AutoRun CD

When you slip in an installer in your Windows-based computer's optical drive, a window would usually pop open that would guide you through the installation. This automatic action is called AutoRun and it's a feature of the Windows operating system. AutoRun works this way: every time you slip in new media such as CDs or DVDs into your PC's optical drive, Windows Explorer will look for a particular file that contains a set of commands that will tell it to launch specific programs contained in the disk. This file is called "autorun.inf" and it is present in most disk installers. You can create your own CD and give it an AutoRun feature by making an autorun.inf file yourself.

1. Learn AutoRun commands.

There are specific command codes that need to be placed in the autorun.inf file in order for it to work.

[autorun] - This is like the title or identifying code, so all autorun.inf files must begin with this code.

icon=icon.ico - Programs are usually launched by clicking or double-clicking its icon. This code tells Windows Explorer to look for the specific icon of a program in the CD and launch the program. A CD that has an installation set up program will have this command in its autorun.inf file: icon=setup.exe

open=exefile - This command code is used in conjunction with the one above and tells Windows Explorer to launch the specified executable program file. Using the same example: open=setup.exe.

ShellExecute=datafile - Sometimes instead of an executable program, you might want to launch a data file. With this command code Windows Explorer will launch the specified data file, opening it with the commonly associated application. Example: ShellExecute=mysite.htm, in this instance Windows will automatically open the html file called "mysite.htm" using Internet Explorer. This code is relatively new and is not recognized by Windows 95 or 98.

2. Create the autorun.inf file in notepad.

autorun.inf files are actually simple text files so creating one only requires Notepad. Open the said text application, and begin typing in the command codes. Remember that each command should have its own line. Let's say you made a CD that contained the home page of your website and you want this html file to launch immediately when the CD is placed in the optical drive, the autorun.inf you should create would look like this:


3. Copy the autorun.inf file into the CD's root directory.

Once you have finished typing in the correct command codes in Notepad, save the file and don't forget to name it as "autorun.inf." Afterwards you just simply need to copy and paste this file into the root directory of the CD you made.

The AutoRun feature was initially invented to add a little automation in the installation of programs from a CD and this generally made the process easier particularly for people who aren't technically proficient with computers.


Share this article!

Follow us!

Find more helpful articles: