Zitat vom Microsoft Developer's Network:


Autorun.inf Commands

This document is a reference for the commands that can be used in an Autorun.inf file.

defaulticon

The defaulticon command specifies an absolute path on the compact disc to the file that contains an icon for the application.

defaulticon=iconpath[,index] 

Parameters

iconpath
Absolute path and file name of a .bmp, .exe, .ico, or .dll file containing the icon. If a file contains more than one icon, you must specify its zero-based index.

Remarks

The icon represents the AutoPlay-enabled CD in the Microsoft(r) Windows(r) user interface. For instance, in Windows Explorer, the CD-ROM will have this icon instead of the standard drive icon. If both the icon and defaulticon commands are present in an Autorun.inf file, AutoPlay uses the icon specified by defaulticon.

icon

The icon command specifies an icon which represents the AutoPlay-enabled CD in the Windows user interface.

icon=iconfilename[,index] 

Parameters

iconfilename
Name of an .ico, .bmp, .exe, or .dll file containing the icon information. If a file contains more than one icon, you must also specify zero-based index of the icon.

Remarks

The icon's file must be in the same directory as the file specified by the open command. If both the icon and defaulticon commands are present in an Autorun.inf file, AutoPlay uses the icon specified by defaulticon.

The following example specifies the second icon in the MyProg.exe file.

icon=MyProg.exe,1 

open

The open command specifies the path and file name of the application that AutoPlay runs when a user inserts the disc in a CD-ROM drive.

open=[exepath\]exefile [param1 [param2]
..]

Parameters

exefile
Fully qualified path of an executable file that will be run when the compact disc is inserted. If only a file name is specified, it must be in CD-ROM's root directory. To locate the file in a subdirectory, you must specify a path. You can also include one or more command-line parameters to be passed to the startup application.

Remarks

See Tips for Writing AutoPlay Startup Applications for further discussion of startup applications.

shell

The shell command specifies a default command for the CD-ROM's context menu.

shell=verb 

Parameters

verb
The verb that corresponds to the command. The verb and its associated command must be defined in the Autorun.inf file with a shell/verb command.

Remarks

When a user right-clicks the CD-ROM icon, a context menu will appear. If an Autorun.inf file is present, the default context menu command is taken from it. This command is also executed when the user double-clicks the drive's icon.

To specify the default context menu command, first define its verb, command string, and menu text with shell/verb. Then use shell to make it the default context menu command. Otherwise, the default menu item text will be "AutoPlay", which will launch the application specified by the open command.

shell\verb

The shell\verb command adds a custom command to the CD-ROM's context menu.

shell\verb\command=Filename.exe 
shell\verb=MenuText 

Parameters

verb
The command's verb. The shell\verb\command command associates the verb with an executable file. Verbs must not contain embedded spaces. By default, verb is the text that is displayed in the context menu.
Filename.exe
The path and file name of the application that performs the command.
MenuText
This parameter specifies the text that is displayed in the context menu. If it is omitted, verb is displayed. MenuText can be mixed-case and may contain spaces. You can set a shortcut key for the menu item by putting an ampersand (&) in front of the letter.

Remarks

When a user right-clicks the CD-ROM icon, a context menu will appear. Adding shell/verb commands to the CD-ROM's Autorun.inf file allows you to add commands to this context menu.

There are two parts to this command, which must be on separate lines. The first part is shell/verb/command, and is required. It associates a string, called a verb, with the application to be launched when the command is run. The second part is the shell/verb command, and is optional. It can be included to specify the text that is displayed in the context menu.

To specify a default context menu command, define the verb with shell/verb, and make it the default command with shell.

The following sample Autorun.inf fragment associates the readit verb with the command string "Notepad abc\readme.txt". The menu text is "Read Me", and 'M' is defined as the item's shortcut key. When the user selects this command, the CD-ROM's abc\readme.txt file will be opened with Notepad.

shell\readit\command=notepad abc\readme.txt 
shell\readit=Read &Me