How to make a Windows AutoPlay CD

Updated: 03/10/2024 by Computer Hope
Computer CD-ROM

To make a CD (compact disc) autoplay in the Microsoft Windows operating system, follow the steps below for the version of Windows on your computer.

Note

This page covers how to create a CD that autoplays in Windows. For information about how to enable or disable the AutoPlay feature, see: How to enable or disable Windows AutoPlay.

In Windows 8, Windows 10 and Windows 11, create an autorun.inf file by pressing Ctrl+X to open the Power User Menu and selecting the Run option. Type notepad in the Run window and press Enter.

In Windows Vista and 7, create an autorun.inf file by clicking Start and typing notepad in the Search field. Click the Notepad program in the search results.

In Windows XP and earlier versions, create an autorun.inf file by clicking Start and selecting the Run option. Type notepad in the Run window and press Enter.

After opening the Notepad program, type the following:

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

In the text above, the open line is for the executable file to automatically run. If the CD has a file other than setup.exe, enter that file name in this line to run it automatically. Next is the icon statement, which specifies the icon to use for the CD. Enter the name of the icon file in the icon line.

Once the three lines above are entered in the Notepad file, save the file as autorun.inf and close the Notepad program. Add the autorun.inf file to the CD being created to make it autorun on a Windows computer when used.

Note

The autorun.inf file has some limited abilities, such as the inability to execute non-executable files. Often many users will want to create an autorun.inf file that executes an HTML (hypertext markup language) file. However, entering "open=index.html" causes an error. For a CD to execute an HTML file, batch file, mail file, or almost any other file, try AutorunPro from GUI Computing Pty Ltd, available on our utility downloads page.