Use of the CD-ROM and Common Drive Autorun Feature
When using computers, often encountered in the drive running automatically, sometimes it's easier and sometimes very annoying, this article explain some mechanisms about autorun, in fact it is very simple, mainly by two files, autorun.inf file in the drive, and the other is a system file cdvsd.vxd. once the operatting system detects that the drive (CD-ROM,USB,HDD,etc) is ready , it will search for the root directory autorun.inf file automatically. if it exists, then Locate destination file from the autorun.inf file, and make it autorun. these proceedings are similar for CD-ROM, hard drives, and removable devices, such as U disk and so on.
A simple example
open the Notepad and create a text file, then rename it to Autorun.inf, click the right-key, and select "edit", press in two lines:
[AutoRun] //AutoRun Node Node
Open = notepad.exe //specify the path and name of the running program, set the environment variable without setting a full path to
Save to D drive and press F5 to refresh it, double-click into the D drive, it will open the nodepad program.
Refer to the above-mentioned autorun.inf file stored in the root directory of the drive and has a certain format, a text file, which is by one or more of the “Node” field, each “Node” line, Node node must be end brackets  enclose said that the attribution of the Node field.
General Autorun.inf supports three Node node: [autorun], [autorun.alpha], [Deviceinstall], of which only [autorun] field must exist.
How to make Autorun.inf can be achieved to run automatically boot
To achieve auto-run feature is only need to use the “Open =” command can be, “Open =” command point to the file must be executable file, for example. Exe,. Com,. Bat, etc.; to develop a document need not be placed in the root directory can also be placed in other directories, but need to specify its full path, for example, Open = / abc / setup.exe runs the CD-ROM or the drive root directory abc folder setup.exe file. Of course, if you need to run the file is not in the above-mentioned three kinds of formats, only need to hand-write mapping files to ready-bat, such as automatically open the readme.txt are all acceptable.
How to customize the display of CD-ROM or the drive icon
In the Autorun Node, use the icon command, under normal circumstances to support the icon ico or bmp format format, but also contains the icons of resources exe and dll files, if the exe and dll file contains multiple icons files, you must specify you want to use the the icon index number, to note that the icon index number is numbered starting from 0, for example, “icon = icons.dll, 3″, then said it would use the fourth icons.dll file icon.
How to customize the CD-ROM or the drive label
CD burning in general, we need to develop all the time label, the label said that the main contents of this CD-ROM brief, such as WindowsXp, FreeBsd Setup, Pdfwriter and so on, see the label each time you use know about the contents of the disc, We can also use the Label command to define the CD-ROM or hard disk drive volume label, such as Label = “WindowsXp”.
How to set up CD-ROM or right-click menu-driven
When we right-click the burn disc, a common VCD, DVD will be put in context menu in the “Auto Play” option, in fact, is the use of Autorun.inf in the Open command to achieve, we can also be added as needed Other menu command.
Add a menu command format is “Shell <menu command name> Command = <to perform the file” “, for example:
shell open command = notepad.exe Notepad
So that when we burn the files into the disc, right-click the CD-ROM in the pop-up menu will have an “open notepad” and commands.
How to change the default action
Double-click the CD-ROM general application autorun.inf default action is to automatically play, that is, behind the implementation of the open file operations. We can also change this default setting, same of using shell command to complete. Example:
shellsetupcommand = /Soft/setup.exe
shell = setup
To understand this statement, we can next to the point of view, when we double-click the CD-ROM, it will be called the last sentence Shell = setup, because it set the sentence, then double-click to find the corresponding Shellsetupcommand will be specified after the command as the default action, Therefore, the operation will become the default implementation of the CD-ROM root directory of the soft folder setup.exe file.
In addition to autorun there autorun.alpha and Deviceinstall 2, autorun.alpha we rarely used, but Deviceinstall used only in Windows XP, using specified in the order Deviceinstall Hardware Wizard to search subdirectories. This is no longer introduced.