Wikia

File Formats Wiki

Autorun file

Talk0
250pages on
this wiki

The autorun function enables any media, such as a CD or USB drive, to perform certain commands after inserting into its drive. The autorun file, autorun.inf, enables this functionality.

Smallwikipedialogo.png Wikipedia has an article related to:

SpecificationEdit

The autorun file is a simple text file that must have the exact filename "autorun.inf". It usually starts with a line containing "[autorun]": [autorun]

Commands in general can be specified using the <option>=<value> syntax.

  • The open command specifies the path to a program that will run once the media is inserted:

open=setup.exe

    • Command-line parameters may be added. Example:

open=setup.exe -autorun

  • The icon command specifies an icon assigned to the media. For example, in Windows, if you open the Computer folder, the icon will appear instead of a default icon for the media type. Example:

icon=kyklo.ico

    • To access an icon resource, specify the index of the icon preceded by a comma. Example:

icon=\setup\resources\jtrset.dll,2

  • The label command specifies a custom name for your media. For example, if you want to name your floppy disk into "Financial Reports", add this to the autorun file (you have to create one if it does not exist):

label=Financial Reports

  • The shell command specifies an option value to run as the default action when the media is opened manually, for example, double-clicking it in the Computer folder.

shell=gbexec.exe (basically similar to the open command)

    • The shell\<option> command adds a context menu option applied to the corresponding media folder. The shell\<option>\command command sets the program associated with the item. Setting shell=<option> will make that option the default action. The items can be nested, delimited by a reverse solidus/backslash (\). You can also specify hotkeys by preceding the hotkey letter with an ampersand (&). Example:

shell=doubleclick.exe
shell\configure=&Configure...
shell\configure\command=setup.exe
shell\install=&Install...
shell\install\command=setup.exe
Shell\Option1=Text1
Shell\Option1\Command=option1.exe
Shell\Option2=Text2
Shell\Option2\Command=option2.bat

  • The shellexecute command opens a file in your computer or a URI using the default program for that file or protocol. Example: shellexecute=%systemroot%\calc.exe, shellexecute=readme.txt, and shellexecute=http://www.example.com. Apparently, this can also be used as replacement for the open command (that is, you can also specify programs).

Around Wikia's network

Random Wiki