This document is a reference for the commands that can be used in an Autorun.inf file.
The icon command specifies an icon which represents the AutoRun-enabled drive in the Windows user interface.
icon=iconfilename[,index]
The icon represents the AutoRun-enabled drive in the Microsoft® Windows® user interface. For instance, in Windows Explorer, the drive will have this icon instead of the standard drive icon. The icon's file must be in the same directory as the file specified by the open command.
The following example specifies the second icon in the MyProg.exe file.
icon=MyProg.exe,1
The label command specifies a text label to represent the AutoRun-enabled drive in the Windows user interface.
label=LabelText
The label represents the AutoRun-enabled drive in the Microsoft® Windows® user interface. If an icon is also specified, the label will be displayed below it.
The following example specifies "My Drive Label" as the drive's label.
label=My Drive Label
The open command specifies the path and file name of the application that AutoRun launches when a user inserts a disc in the drive.
open=[exepath\]exefile [param1 [param2] ...]
See Tips for Writing AutoRun Startup Applications for further discussion of startup applications.
Version 5.0. The shellexecute command specifies an application or data file that AutoRun will use to call ShellExecuteEx.
shellexecute=[filepath\]filename[param1, [param2]...]
This command is similar to open, but it allows you to use file association information to run the application.
The Shell command specifies a default command for the drive's shortcut menu.
shell=verb
When a user right-clicks the drive icon, a shortcut menu will appear. If an Autorun.inf file is present, the default shortcut menu command is taken from it. This command is also executed when the user double-clicks the drive's icon.
To specify the default shortcut menu command, first define its verb, command string, and menu text with shell/verb. Then use shell to make it the default shortcut menu command. Otherwise, the default menu item text will be "AutoPlay", which will launch the application specified by the open command.
The shell\verb command adds a custom command to the drive's shortcut menu.
shell\verb\command=Filename.exe shell\verb=MenuText
When a user right-clicks the drive icon, a shortcut menu will appear. Adding shell/verb commands to the drive's Autorun.inf file allows you to add commands to this shortcut 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 shortcut menu.
To specify a default shortcut 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 drive's abc\readme.txt file will be opened with Notepad.
shell\readit\command=notepad abc\readme.txt shell\readit=Read &Me