Article ID: 291575 - Last Review: April 5, 2006 - Revision: 2.0 How To Use Visual Basic to Locate CD-ROM DrivesThis article was previously published under Q291575 On This PageSUMMARY
You can find the drive letter of any CD-ROM drive on a local computer by using the Win32 API from Visual Basic. This can be useful during scenarios such as program setup and querying a user for media.
MORE INFORMATION
You can use the GetDriveType API to determine the type of drive referenced by a drive letter. By combining this API with a list of the active drive letters on a computer, you can search for CD-ROM drives available on that computer. Note that the API does not distinguish between types of CD-ROM drives, so for example, a DVD drive is considered a CD-ROM drive. The following code sample demonstrates how to search for local CD-ROM drives by using Visual Basic. Sample Code
REFERENCESFor additional information, click the article numbers below
to view the articles in the Microsoft Knowledge Base:
190000
(http://support.microsoft.com/kb/190000/EN-US/
)
How To Get Started Programming with the Windows API
180766
(http://support.microsoft.com/kb/180766/EN-US/
)
VBA: Sample Code to Determine CD-ROM Drive Letter
291573
(http://support.microsoft.com/kb/291573/EN-US/
)
How To Use Visual Basic to List Active Logical Drives
The Visual Basic Programmer's Guide (available on MSDN Online, http://msdn.microsoft.com
(http://msdn.microsoft.com)
) | Article Translations
|
Back to the top
