Sunteți pe pagina 1din 3

Make the autorun.

inf file for your burned CD-ROMs


by Mark Kaelin | More from Mark Kaelin | Published: 3/2/06
Keywords: Storage | Multimedia
Rating: 4.7 (out of 5) Rate it Comments: 13 | 0 NEW | View all

Update - Today: You can create the autorun file for a DVD in much the same way.
Save to my Workspace
Takeaway:
Burning CD-ROMs has quickly become a common and accepted business practice. CDs are one
more good way to communicate with customers, investors, and employees. The autorun.inf file can
simplify a user's experience, and you don't need sophisticated software to make it.

Problem
Contrary to what you may have heard from the RIAA, burning a CD-R or CD-RW is not
restricted to music pirates. In many business situations, the burned CD is the best way to
distribute information to a target audience. For communications involving PowerPoint
presentations, HTML, PDF forms, Flash animations, or a number of other applications, the
portable and durable CD has become a common delivery method.

The compact disc drive autoplay feature, common to most operating systems, is a good way
to simplify user experience. Autoplay is controlled by a simple text-only file called
autorun.inf. While there are dozens of software utilities available that will help you create
the file, all you really need is a text editor and some basic knowledge.

Solution 1
The basic configuration of the autorun.inf starts the program to run when the CD is inserted
in the drive, and the icon to display when the disc is viewed by Windows Explorer or other
directory listing software. The text-only file, which resides in the root directory of the CD,
should look like this:

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

The icon file should also reside in the root directory of the CD.

Variations

Often the program you want to run will not be located in the root directory of the CD. If that
is the case you must include the path:

[autorun]
open=folder1\folder1A\myfile.exe
icon=myicon.ico

Sometimes you may need to pass an argument to the program to be autoplayed:

[autorun]
open=myprogram.exe /argument
icon=myicon.ico
Not a program

Sending customers, salespeople, investors, and employees presentations, PDF files, and
HTML documents requires a slight variation to the basic autorun.inf file and the addition of a
DOS batch file to the CD root directory. The autorun.inf file opens a batch file, which then
opens the file using the default program designated for that file type. For example:

[autorun]
open=autorun.bat index.htm
icon=myicon.ico

And the autorun.bat file reads:

echo off
@start %1 %2 %3 %4 %5 %6 %7 %8 %9
@exit

Using the autorun.inf file to autoplay your burned CDs will prevent another headache for
your users and increase the likelihood of reaching your target audience. And because it is a
simple text file, it can be created with a text editor and your normal disc-burning software.

Solution 2
Although creating your autorun.inf file according to Solution 1 will work for 98 percent of
your users, it will fail for the two percent who have issues with the autorun function in their
particular installation of Windows. The batch file in the first solution makes no allowances for
errors and will merely fail when an error is encountered.

Extending the solution

Solution 2 was added to the original Solution Base article after several TechRepublic
members used the article discussion to note the benefits of using shell utilities for the
autorun process.

This is where a shell utility can save the day, because these little apps contain routines for
handling common errors and will complete the autorun process even if an error is
encountered. For this example, we'll use AutoRun.exe, which can be downloaded from
Tarma Software Research. Tarma has made AutoRun.exe freely available for both personal
and commercial use, and there are no requirements for copyright notices, etc.

To use AutoRun.exe, you make a simple modification to the autorun.inf file by replacing
autorun.bat. The basic autorun.inf would look like this:

[autorun]
open=autorun.exe index.htm
icon=myicon.ico

The only other requirement is that a copy of the 8-KB autorun.exe file be included in the
root directory of each burned CD. This application also contains several options and supports
an extended autorun.inf structure that provides more flexibility in how you design your CD
package.

S-ar putea să vă placă și