How do you disable the CD autoplay (then re-enable it)?
Printable View
How do you disable the CD autoplay (then re-enable it)?
System Properties->Device Manager
Choose your CD drive and turn Auto-Insert notification off.
no sorry, i ment, at runtime in VB.
Oh hehe sorry :)
From MSDN:
Quote:
Using the Registry to Disable AutoPlay
There are two registry values that can be used to persistently disable AutoPlay: NoDriveAutoRun and NoDriveTypeAutoRun. The first value disables AutoPlay for specified drive letters and the second disables AutoPlay for a class of drives. If either of these values is set to disable AutoPlay for a particular device, it will be disabled.
Note: The NoDriveAutoRun and NoDriveTypeAutoRun values should only be modified by system administrators to change the value for the entire system for testing or administrative purposes. Applications should not modify these values, as there is no way to reliably restore them to their original values.
The NoDriveAutoRun value disables AutoPlay for specified drive letters. It is a REG_DWORD data value, found under the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer key. The first bit of the value corresponds to A:, the second to B:, and so on. To disable AutoPlay for one or more drive letters, set the corresponding bits. For example, to disable the A: and C: drives, set NoDriveAutoRun to 0x00000005.
The NoDriveTypeAutoRun value disables AutoPlay for a class of drives. It is a REG_DWORD or 4-byte REG_BINARY data value, found under the HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer key. By setting the bits of this value's first byte, different drives can be excluded from working with AutoPlay.
The following table gives the bits and bitmask constants, that can be set in the first byte of NoDriveTypeAutoRun to disable AutoPlay for a particular drive type. For Microsoft® Windows NT and Windows 2000, you must restart Windows Explorer before the changes take effect.
Bit Number Bitmask Constant Description
0x04 DRIVE_REMOVEABLE Disk can be removed from drive (such as a floppy disk).
0x08 DRIVE_FIXED Disk cannot be removed from drive (a hard disk).
0x10 DRIVE_REMOTE Network drive.
0x20 DRIVE_CDROM CD-ROM drive.
0x40 DRIVE_RAMDISK RAM disk.
thanks