Test an AutoRun CD
When you insert a CD into your computer's CD-ROM drive, Windows senses the new CD and looks for a file in its root folder called Autorun.inf
Autorun.inf is a plain ascii text file that you can edit in Notepad or any similar TEXT editor.
Sample Autorun.inf contents:
[autorun]
open = program.exe
icon = programicon.ico
The open= line tells Windows what program to launch when a user inserts the CD.
The icon= line tells Windows what icon to display for the CD (the icon file needs to be in the root folder of the CD as well for this to work.)
It'd be time-consuming and expensive to burn CD-ROMs until you got everything working just right. Luckily, there's a faster, cheaper way: use a floppy or ZIP drive and spoof Windows into thinking it's a CD. Naturally, if you plan on testing an AutoRun CD that includes the PowerPoint Viewer or large files of any other sort, you'll need to use a ZIP drive rather than a floppy.
Copy this information into Notepad:
REGEDIT4 [HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer] "NoDriveTypeAutoRun"=hex:91,00,00,00
Now choose File, Save As and type "AutoFloppyStart.REG" as the file name and save.
Include the quote marks when you type the file name or Notepad will add a .TXT extension to the file name.
While you still have the file open in Notepad, edit it a bit further. Change the 91 to 95
Save As again, this time naming it "AutoFloppySTOP.REG"
Doubleclick AutoFloppyStart.REG
This will move its contents into the Windows registry.
Now you can copy your test Autorun.inf file to a diskette (along with any other needed EXE or ICO files) and test the Autorun from the floppy. Insert the floppy in the diskette drive, right-click its icon in Explorer, then choose Autoplay from the pop-up menu.
If your Autorun.inf uses specific paths, you may have to edit it to match the path to your floppy drive rather than the CD.
Note: It's best to avoid specific paths -- you can never be certain what a user's CD drive letter will be.
When you're done testing, you can leave this automatic floppy startup feature enabled if you like, or disable it by doubleclicking AutoFloppySTOP.REG
Here's an even handier trick that needs no registry diddling:
Create a folder on your hard drive to hold your Autorun.inf and other CD contents. Let's call it C:\CD for example. Now assume that you want to use X: as your test CD drive letter.
Click Start, choose Run and type:
SUBST X: C:\CD
then click OK.
This creates a "pseudo" drive whose letter is X:
Copy your Autorun.inf and other CD files to X:
While you can't eject and re-insert this ersatz X drive, Windows will treat it as though it were an autoinserted CD when you access it. If it finds an Autorun.inf file there, it runs it just as it would an Autorun.inf on a newly inserted CD. To test this, navigate to the X: drive in Explorer.
To remove the substituted X: drive, click Start, choose Run and type:
SUBST X: /D
Your files will still be in the C:\CD folder but Windows will no longer treat it as an autorun drive.
There are a few minor differences between the way SUBST'ed drives work in various versions of Windows. You may have to click on the drive icon then press Enter or rightclick and choose AutoPlay. This trick may not work in WinME at all.
Be sure to test your Autorun.inf on a real CD before turning it loose on the world.