Autorun.inf - autorun HTML, PDF, PPT, DOC and more

Autorun.inf - what is inside?

When you insert a CD into the computer, Windows looks if AUTORUN.INF file is located in the root folder of a CD. If AUTORUN.INF is found, then Windows follows the instructions in this file to run a program. Take a look at the following sample AUTORUN.INF file:


This sample AUTORUN.INF file tells Windows to run Setup.exe program located in the CD root folder. Also it specifies that Windows should use first icon from Setup.exe to display this CD in Explorer.

Learn more details about AUTORUN.INF

How to autorun documents with Autorun.inf?

To autorun a document instead of a program, you should use shellexecute command instead of open command.


Autorun.inf drawbacks

If you use shellexecute to autorun documents you can not ensure that user will have the appropriate software to read your document on their computers. There is no way to check if, for example, DOC file can be opened.

Another problem is that you can not start more than one document on CD insertion.

How to autorun documents hassle-free?

1st AutoRun Express allows you to autorun any DOC, HTML, PDF or PPT file with a few clicks, without any design or programming required. You can start one or many documents, display a menu if required. And you can ensure that users will have the appropriate software on their computers!

Create autorun menu with 1st Autorun Express in a few clicks, without design or programming required!

Why Autorun.inf does not work on my or user's computer?

Your CD users may have switched off autorun. This might be because they are concerned about viruses. Also, if they press the Shift key down while inserting the CD, AutoRun is disabled. In Windows NT4, 2000 and XP systems, only Administrators and Power Users can use AutoRun.

There is no way to force your users to use AutoRun. It is therefore good practice to provide instructions so that users know how to start your CD, eg tell them to open file index.htm in their browser. These instructions are also required if your CD might be viewed by non-Windows users.

How to disable Autorun.inf?

To test AutoRun you need to have it enabled on your computer. A registry setting can be used to disable AutoRun. Click Start|Run then type in regedit. Select Edit|Find and type in NoDriveTypeAutoRun. This value should be found in this key: HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer.

The NoDriveTypeAutoRun value should be hexadecimal 95 if AutoRun is enabled on all CDs, or B5 if disabled for CDs. (If you want to test AutoRun on a floppy disk, set this value to 91.) You may need to change more than one instance of NoDriveTypeAutoRun in the registry. You usually need to reboot for a new value to take effect.

In Windows 95/98/Me the NoDriveTypeAutoRun value is displayed as 95 00 00 00. In Windows NT4, 2000 and XP this value is displayed as 0x00000095 or hexadecimal 95. If you modify the NoDriveTypeAutoRun value make sure it is still in the correct format.

There are two other - uncommon - ways of disabling AutoRun. The NoDriveAutoRun registry value is in the same key as NoDriveTypeAutoRun. Each bit represents each drive, so hexadecimal 01 disables AutoRun for floppy drive A, 04 disables AutoRun for drive C, 10 disables AutoRun on E. Values can be combined, so 19 disables AutoRun on E, D and A.

If either NoDriveTypeAutoRun or NoDriveAutoRun specify that AutoRun should be disabled for a drive, then it is disabled for that drive.

Finally, programmers might like to know that AutoRun can also be disabled by the program that controls the foreground window by handling the "QueryCancelAutoPlay" Windows message. Please consult the Microsoft documentation for more details.

How to test Autorun.inf?

If you want to preview your autorun CD without actual burning, then you may try the SUBST command. This command allows you to create a virtual drive that is actually a folder on your physical drive.

Copy your autorun CD contents into the specific folder on your CD. Let's it be "C:\My CD". Then click Start|Run and enter:

subst O: "C:\My CD"

Where O: is an unused drive name. Click OK and after this command you will find a new drive O: in My Computer with the same contents as in C:\My CD folder. It should display an icon specified in AUTORUN.INF and when you double-click its icon it will autorun.

To remove substitution later please use the following command:

subst O: /d

Also, when you are using our utility 1st AutoRun Express to create autorun cd, then you may test how autorun will run directly from inside the program.

Autorun.inf and mixed cds

Enhanced CDs contain both music audio and computer data, so they can be played on audio equipment and used on a computer. (Enhanced CDs are also known as CD Extra or CD Plus CDs.) Note that the Mixed-mode CDs also contain audio and data, but these may not be playable on audio equipment.

Note that not all Windows computers will recognise the data on an Enhanced CD, although the audio is always seen. (Windows Me, 2000 and XP usually seem to recognise Enhanced CD data, but it may be drive dependent.) Therefore, do not use this format if you want to be sure that your data is available.

If the Enhanced CD data does not have an AUTORUN.INF file, then Windows will usually start playing the CD when it is inserted. However, if an AUTORUN.INF is present, then Windows will follow the instructions in there rather than playing the CD.

The data on an Enhanced CD can only use short filenames or folder names. Long filenames will be truncated to an "8.3" form, eg "index.html" may appear as "INDEX~1.HTM".