Pages

Tuesday, July 29, 2008

Autorun Your CD-ROM using Autorun.inf File

Wondering how to make a CD-ROM automatically play or execute a program from any of your "burned" program or file in your CD-ROM? Well this info is something that you should know ages ago.

The Autorun.inf file is a text file located in the root directory of the compact disc. This file contains the name of the startup application on the disc (the application that runs automatically when the disc is inserted in the CD-ROM drive), and the icon that you want to represent the AutoPlay-enabled compact disc in the Windows user interface. The Autorun.inf file also can contain optional menu commands that you want added to the shortcut menu, which is displayed when the user right-clicks the CD-ROM icon.

At a minimum, an Autorun.inf file contains three lines of text and identifies the startup application and the icon, as shown in the following example:

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

The [autorun] section identifies the lines that follow it as AutoPlay commands. An [autorun] section is required in every Autorun.inf file. The open command specifies the path and file name of the startup application, and the icon command specifies the file that contains the icon information.

The Autorun.inf file also can contain architecture-specific sections for Windows NT 4.0 running on RISC processors. For each type of processor architecture, add a section to the Autorun.inf file that contains the file name of the startup application you want to run for that architecture. For x86 architectures, use the standard [autorun] line. Use [autorun.mips] to run an application on MIPS architecture, [autorun.alpha] for applications on the Alpha architecture, and [autorun.ppc] for the PowerPC architecture. The following example shows how to create an Autorun.inf file that runs different startup applications depending on the computer architecture:

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

[autorun.mips]
open=filenam2.exe
icon=filename.ico

[autorun.alpha]
open=filenam3.exe
icon=filename.ico

[autorun.ppc]
open=filenam4.exe
icon=filename.ico

The shell checks for an architecture-specific section first. If it does not find one, it uses the information in the [autorun] section. After the shell finds a section, it ignores all the other sections, so make sure each section contains all the information for that architecture.

If only Autorun.inf script could automate some part of my life like driving to office in crowded highway.

No comments: