Creating a CD That Will Automatically Play

Windows 95+ can detect if and when a CD is inserted into a CD drive. When this happens, Windows searches for a text file titled "autorun.inf" for information about the CD and/or instructions. The "autorun.inf" file can contain instructions telling Windows to run an executable program. Thus, you can designate applications to launch automatically when a CD is insterted in the the CD drive. You can also tell Windows where to find an icon (.ico) file that will graphically represent the program.

To accomplish this, do the following:

  1. Open Notepad (as the autorun.inf file is simply a text file, we can create it in notepad)

  2. Type the following (replace "yourfile" with the appropriate name of your file):

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

  3. Hit save as, and change the "Save as Type" field to "All files". Then, name the file "autorun.inf"

  4. That's it. Now you simply have to include the autorun.inf file in the root directory (not buried in a folder) with your executable file (.exe), your icon file (.ico), and any dependent and/or other necessary files on the CD that you burn.

For more information on autorun.inf commands, see:

For more information on .ico files, see: