Sie sind auf Seite 1von 5

autorun.inf is the primary instruction file associated with the autorun function.

autorun.inf itself is a simple text-based configuration file that tells the


operating system which executable to start, which icon to use, and which
additional menu commands to make available. in other words, autorun.inf tells
windows how to deal open the presentation and treat the contents of the cd.

the entire sequence is initiated when the "disk change notifcation" polling
discovers a new disk in the cd or dvd rom drive. then, if the "auto insert
notification" feature is enabled (it is by default), windows checks in the new
disk's root directory for the existence of an "autorun.inf" file. if found,
windows then reads and follows the specific instructions this file defines. if no
autorun.inf file is found, then windows refers to the new disk by its serial
number and executes the default actions associated with the (data or audio)
content on the disk.

the autorun.inf file defines the following:


autorun.inf defines the following: the process or application that will
automatically run when a disk is inserted
automatically run when cd is inserted optionally, one can define the process or
application that will run for specific operating environments.
icon representing cd or dvd the icon that will represent your application's cd or
dvd when the drive is viewed with my computer or explorer.
menu commands when cd-rom is clicked menu commands displayed when the user
right-clicks the cd-rom icon from my computer or explorer.

a simple autorun.inf example:


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

a complex autorun.inf example:


this example is used in the following section for complete definition and
descriptions.
[autorun]
open=filename.exe /argument1
icon=\foldername\filename.dll,5
[autorun.mips]
open=filenam2.exe
icon=filename.ico
[autorun.alpha]
open=filenam3.exe
icon=filename.ico
[autorun.ppc]
open=filenam4.exe
icon=filename.ico
shell\install = &install
shell\install\command = setup.exe
shell\uninstall = &uninstall
shell\uninstall\command = uninstall.exe
shell\readme = &read me
shell\readme\command = notepad readme.txt
shell\help = &help
shell\help\command = helpfilename.hlp
this section describes the configuration of the autorun.inf file and each of the
potential items.

example autorun file: description:


[autorun] [autorun] is the primary, required section name.
open=filename.exe /argument1

open is the keyword to determine what action to take upon insert notification.
filename.exe is the value defining the application that will be automatically
started.
/argument1 is the argument, parameter or switch passed to the application being
run. logically, any command line parameters used must be supported by the
application.
icon=\foldername\filename.dll,5

icon is the keyword to determine the icon used for the disk.
filename.dll is the value defining the file containing the icon.
,5 is the argument to the icon resource defining which icon to display.

note: by default, the system looks for the file in the root directory of the
inserted disk. if you want to access a file located in a specific folder or
subdirectory, specify a path relative to the root.

example: open = foldername\filename.exe this will not change the current


directory.

although autoplay is the default menu item, you can define a different command to
be the default by including the following line. shell = verb

when the user double-clicks on the icon, the command associated with this entry
will be carried out.

note: a more common method of defining the icon resouce is an explicit reference
to a .ico file. example: icon=autorun.ico

note: the icon defined representing your application's cd or dvd is the drive icon
as viewed with my computer or explorer. valid file types containing icons include
.ico .bmp .exe .dll if the file includes more than one icon, by default, the
second icon in the files icon resource will be displayed.

example autorun file: description:


[autorun.mips] defining the autorun items for a mips machine
open=filenam2.exe the platform specific application to run
icon=filename2.ico the platform specific autorun icon
[autorun.alpha] defining the autorun items for a dec alphamachine
open=filenam3.exe the platform specific application to run
icon=filename3.ico the platform specific autorun icon
[autorun.ppc] defining the autorun items for a power pc
open=filenam4.exe the platform specific application to run
icon=filename4.ico the platform specific autorun icon
shell\install = &install the keyword defining a menu item and the hot key for
that item
shell\install\command = setup.exe the keyword defining the operation to perform
when the user selects this item
shell\uninstall = &uninstall additional menu item example
shell\uninstall\command = uninstall.exe additional menu item example
shell\readme = &read me additional menu item example
shell\readme\command = notepad readme.txt additional menu item example
shell\help = &help additional menu item example
shell\help\command = helpfilename.hlp additional menu item example
**********************************************************************************
**********************************************************************************
*************************
introduction to autorun.inf

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. if you want your program,
document, presentation or web page to be open, once a cd is inserted, then you
need to create autorun.inf file or just use our free 1st autorun express utility.
autorun.inf samples

we'll learn autorun.inf structure in details later. now take a look at the
following sample autorun.inf file:

[autorun]
open=setup.exe
icon=setup.exe,1

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.
how to create autorun.inf?

you may create and edit autorun.inf file manually (using windows notepad) or you
may use free 1st autorun express utility to create your own autorun cds with a few
clicks!
autorun.inf structure and commands

autorun.inf is a text file that should contain an autorun section. this section
starts with a header:

[autorun]

and should be followed with commands. there are the following commands available:

icon=my.ico
icon=setup.exe,1

icon command specifies an icon for the cd drive in my computer. you may specify an
icon file directly or an exe/dll file with icons inside and specify an index of
the desired icon. please note, that 1st autorun express allows you to pick icons
visually and copies icon automatically to the burning folder if you pick an icon
outside the cd.

label=my presentation

label command specifies a text label that is displayed for this cd in explorer

shell\readme\command=notepad readme.txt
shell\readme=read &me
shell\software\command=setup.exe
shell\software=setup the software

use a series of shell commands to specify one or more entries in the pop-up menu
that appears when the user right-clicks on the cd icon. (the shell entries
supplement the open command.)

this example shows how to add two entries to the menu (read me - to display the
readme.txt file in notepad, and setup the software - to start the software
installation by running the "setup.exe" file.)

any verb string (without spaces) can appear after "shell\"; "readme" and
"software" were used above.

on one line, append "\command=" followed by the command you want to run. on the
next line, append "=" and the text that appears in the menu. put an ampersand
character (&) before the character that should be used as the menu item short-cut
key.

[deviceinstall]

windows xp also supports a [deviceinstall] section in autorun.inf with the


driverpath command specifying a base directory for driver file searches.

[autorun.mips]
[autorun.alpha]
[autorun.ppc]

autorun.inf may have other sections for other nt/w2000 users, ie mips, dec alpha,
and powerpc.
autorun.inf drawbacks

major autorun.inf drawback is that it only allows you to run programs, but not
documents, html pages etc.

if you target windows 2000/xp only, then you may overcome this limitation by using
shellexecute command. otherwise you can try to use the "start" command as in the
following example:

[autorun]
open=start index.html
**********************************************************************************
**********************************************************************************
*************************
for a vcd
start notepad and copy and paste the italic text:

[autorun]
open=mplayer2.exe /play /close \mpegav\avseq01.dat

and last do you save the file as autorun.inf , remember to select save as file
type: all files in notepad. now it is just to drag that autorun.inf to root folder
when creating the vcd example like this in nero creating a vcd:
**********************************************************************************
**********************************************************************************
*************************
for svcd
start notepad and copy and paste the italic text:

[autorun]
open=mplayer2.exe /play /close \mpeg2\avseq01.mpg

this only works if you have software dvd player installed, or else could you
include a software dvd player on the svcd, but it wont autoplay after you have
installed the software is installed.
and last do you save the file as autorun.inf , remember to select save as file
type: all files in notepad. now it is just to drag that autorun.inf to root folder
when creating the svcd for example like this in nero creating a svcd:

however, if you do this, windows displays a dos box briefly, and "start" command
might not be available on some systems.

if you want to open documents, web pages etc. in any windows version guaranteed
and without flickering dos box, then you may use free 1st autorun express utility
to create your own autorun cds with a few clicks.
*********************************************************************************
**********************************************************************************
**************************
for a divx, avi
start notepad and copy and paste the italic text:

[autorun]
open=mplayer2.exe /play /close \yourmovie.avi

change the yourmovie.avi to your moviename, and to play a divx you need have a
divx codec installed.

and last do you save the file as autorun.inf , remember to select save as file
type: all files in notepad. now it is just to drag that autorun.inf to root folder
when creating the cd
**********************************************************************************
**********************************************************************************
**************************each section contains a series of commands that
determine how the autorun operation takes place. there are five commands
available.
command description
defaulticon specifies the default icon for the application.
icon specifies the path and file name of an application-specific icon for the cd-
rom drive.
open specifies the path and file name of the startup application.
useautorun specifies that autoplay v2 features should be used if supported.
shell defines the default command in the cd-rom's shortcut menu.
shell_verb adds commands to the cd-rom's shortcut menu.

the following is an example of a simple autorun.inf file. it specifies


filename.exe as the startup application. the second icon in filename.exe will
represent the cd-rom drive instead of the standard drive icon.

[autorun]
open=filename.exe
icon=filename.exe,1

this autorun.inf sample runs different startup applications depending on the type
of computer.

[autorun]
open=filename_x86.exe
icon=iconfile.ico

[autorun.alpha]
open=filename_risc.exe
icon=iconfile.ico

Das könnte Ihnen auch gefallen