The Autorun.inf file
and the AutoRun technology
When you create a CD/DVD menu with
SamLogic CD-Menu Creator you have the option to create a file with the
name Autorun.inf. This file is very important if you want to
create an autorun / autoplay menu (a menu that opens automatically) because it instructs Windows
which
application that should be launched when the CD or DVD is inserted in
the drive.
The Autorun.inf
file must always be located in the root
directory of the CD/DVD. If you place it in a sub directory Windows
will not found it. When you insert the disc Windows will look after Autorun.inf
in the root directory and if it find it, it will read the file and
interpret the contents of it.
This feature to
automatically start programs on compact
discs is sometimes referred as the Windows AutoRun technology. All
Windows since Windows 95 have this technology built-in. Almost all
software that is distributed via CD or DVD uses this technology to
automatically open menus or start programs. You can read more about this
in the related article: Why Create an
Autorun Menu For Your CD or DVD?.
What is inside
Autorun.inf?
Autorun.inf is a text file
and in its basic form it look like this:
[AutoRun]
OPEN=MYAPP.EXE
The OPEN
command
specifies which program that should be run when the CD/DVD is inserted
in the drive. In the example above a program with the name MYAPP.EXE
will be executed.
When you create an Autorun.inf file you can use Notepad as an
editor. The example above should look like this in Notepad:

Autorun.inf can also
specify an icon that will represent your application's CD or DVD in
the Windows user interface (for example in Windows Explorer). To specify a new icon to the CD/DVD drive, Autorun.inf
should contain the following commands:
[AutoRun]
OPEN=MYAPP.EXE
ICON=MYICON.ICO
The ICON
command
specifies the filename of the new icon to display. In this case an
icon with the filename MYICON.ICO will be used.
In the examples above the program file and the icon file most be located
in the root directory of the CD/DVD, but you can also access files
located in a sub directory on the CD/DVD if you specify a relative path.
Example:
[AutoRun]
OPEN=FOLDER\MYAPP.EXE
The OPEN and ICON
commands are the most used in Autorun.inf files, but there are
more commands available. You can for example specify a new disc label
with the LABEL command. The
LABEL command has the benefit that you can
specify labels that contains more than 16 characters (16 is the normal
limit for CD/DVD labels).
A list and a description of the commands that can be used in Autorun.inf can be
found at the following page: Autorun.inf
- Commands.
If you want a more detailed information about the commands
you can also take a look at the following Microsoft page:
Autorun.inf Entries.
Is it possible to
show documents automatically with Autorun.inf?
Yes, it is possible. There is a
command with the name
SHELLEXECUTE that can be used to open
documents automatically. If you specify a filename after
SHELLEXECUTE, for example like this:
[AutoRun]
SHELLEXECUTE=INFO.TXT
the command will open the document
(in this case with the filename INFO.TXT) automatically when the
CD/DVD is inserted in the drive.
The
SHELLEXECUTE command can be used to
automatically open for example Word, PDF or HTML files, or play
movies. But you should be aware of that there must exist a program
that can read the document or movie format, otherwise the command
will fail. If you use
SHELLEXECUTE to open a PDF file, there
must be a copy of Adobe Reader installed. Otherwise the PDF can not
be opened.
If you want to handle cases where a viewer program might be missing,
you can use a general document launcher program instead. For example
our program
SamLogic Autorun Creator will handle cases where a proper viewer
program is missing.
In some computers
the AutoRun feature do not seems to work, why?
As mentioned before, all Windows since
Windows 95 have the AutoRun technology built-in, but in some computers
this feature can be disabled. Administrators can disable this features
in client computers on a network for security reasons and some
applications, for example CD burning programs, can sometimes also disable this
feature.
If AutoRun is disabled on a
computer you can enable it by changing a value in the registry. There
is a value with the name NoDriveTypeAutoRun
at the following key:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
that probably is B5
(hexadecimal). If that is the case, you can change it to the
hexadecimal value 95 and then restart the computer. After the
reboot the computer should have the AutoRun feature enabled again.
The NoDriveTypeAutoRun
value contains a bit mask where every bit that is set disables a drive
type. The default value for NoDriveTypeAutoRun
is 95, giving the bit pattern 10010101. Bit number 5 enables/disables
AutoRun on CD-ROM drives and as default this bit is cleared (zero). By
setting this value to B5, the bit number 5 will be set (one) and the
CD-ROM drive is disabled. The bit pattern for B5 is 10110101.
It's also possible to
enable/disable AutoRun on other drive types than CD-ROM by
clearing/setting other bits in the NoDriveTypeAutoRun
value. For example it's possible to have AutoRun enabled for floppy
disks. In the table below you find some of the bits and what drive
types they represent.
Bit 2 = Disk can be removed from drive (such as a floppy disk)
Bit 3 = Disk cannot be removed from drive (a hard disk)
Bit 4 = Network drive
Bit 5 = CD-ROM drive
Bit 6 = RAM disk
To enable AutoRun you must clear
the corresponding bit. You
can read more details about enabling/disabling the AutoRun feature at
the Microsoft page:
Enabling and Disabling AutoRun.
This article refers to:
SamLogic CD-Menu Creator 2010
Other articles
More articles are available from the article index
page.
|