How to disable CD-ROM auto-run in Windows XP
- Run the Registry Editor (regedit.exe)
- Go to HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Cdrom
- Change the value of the key AutoRun to 0.
(Source: http://www.annoyances.org/exec/show/article03-018)
A less invasive method for disks without autrun.inf (such as music, dvd, and picture disks) is to right click on the disk drive and select properties. Under the AutoPlay tab you can set different actions for different media types.
You can also hold down shift while inserting the disk to prevent disks from auto-running.