Using AutoPlay for Windows '95

What I really like about the AutoPlay structure...

~is that it is totally non-intrusive. It relies only on a simple ASCII file (AUTORUN.INF) being in the root directory of the CD, and the fact that Win95’s 32-bit CD drivers automatically detect CD insertion and search for that particular file.

Another thing to like is the absolute simplicity of the AutoPlay syntax - a grand total of five possible commands.

The smallest autorun.inf file contains two lines of text and simply identifies the startup application:



So, in most cases, the OPEN= is going to be the name of your setup application, and after that you can do as you please. Now that’s simple! You can specify an absolute CD path as well, but otherwise AutoPlay assumes the root directory of the CD. If the file you specify is a registered document, Win95 starts the application associated with the specified document. I’m not sure I’d use this option, as it makes some assumptions that I’m not too happy about, but in the corporate environment, it may well come in handy. You can also include command-line parameters as required.

Another cool feature is the default icon argument. This is what Windows ‘95 uses to set the icon for the CD in Explorer (and even My Computer, if you can stand using it). The syntax is :


which provides an absolute CD path (sans drive letter, of course) to locate the icon that represents the CD. You can also specify an .exe, .bmp or .dll file. If you have more than one icon in the file, you’ll need to add a zero-based offset argument. To whit :

defaulticon=myfile.exe 1

One option I’d like everyone to keep away from is the shell=verb command. This changes the default entry of the shortcut menu to the specified custom command. This sounds great on paper - what could be handier than setting a convenient default for users from Explorer (or that other ‘My Computer’ thingy)? Now double-click on a CD that uses this ‘feature’. What you get is, not what you expect - a directory listing. Which runs absolutely counter to the whole notion of a consistent interface. I guess it might be handy for applications which run exclusively from the CD, but it is certainly confusing. Even worse is the fact that, unavoidably, AutoPlay-enabled CDs set the default to ‘Autoplay’.

A verb is the abbreviated version of a custom command you also specify using the shell\verb\command and shell\verb commands. shell\verb provides the menu item name on the shortcut menu, while shell\verb\command provides the actual command syntax. I’m experimenting with using this feature to override the default ‘Autoplay’ option, but without 100% success yet.

My testing has brought one other interesting fact to light - this stuff is not easy to test, unless you happen to own both a CD cutter and a generous boss. There's no test rig I can find, and suggestions are

UPDATE March 97: See the follow up article Testing Autorun.inf in the March 97 issue.