AutoPlay enables a CD to start automatically when you place it in the drive, and it usually kicks off a setup program. This works by way of a file called Autorun.inf, which sits in the root directory of the drive—commonly the CD drive. The AutoPlay function provides a novel method of distributing programs to users over a network. The basic format simply points to an executable program. For example:[Autorun]
You can also configure AutoPlay to work with network drives by editing the registry. Here's how:
- On the Windows 9x computers that will access the network drive, start the Registry Editor by typing Regedit.exe in the Run dialog box.
- Browse to HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\
- Change the first byte of this value from 95 to 85, and leave the other three bytes as 0. This allows network drives to recognize the Autorun.inf files.
- Map a drive letter to a network share, perhaps through the login script. This technique will only work with the root of mapped drives.
- Exit the registry.
Once you've edited the registry and mapped a drive letter to a network share, you're ready to finish the task. Follow these steps:
- Copy your application to the shared folder that's been mapped to from the Windows 9x computers. There should be an executable file in this folder that either sets up an application or starts one and doesn't need an installation program.
- Create the following Autorun.inf file in Notepad or other text editor:
where executable.xxx is the name of the file to be run.
- Save this file in the root of the mapped drive and open My Computer.
- Right-click the drive icon. If you don't see an AutoPlay option, press [F5] to refresh the drive list, which will force the Autorun.inf file to be reread—provided you've set the registry entry correctly.
- Double-click the drive, and the application will start automatically, instead of opening an Explorer window into that drive.
This is an inexpensive way to distribute simple software that's periodically updated. Where disk space is plentiful, it may also provide you with a cost-effective alternative to a CD jukebox. But perhaps the biggest benefit is that users won't become frustrated searching for setup icons on drives—simply instruct them to "double-click drive X" to run the application.
Note: Editing the registry is risky, so be sure you have a verified backup before saving any changes.