Home
Search
 
What's New
Index
Books
Links
Q & A
Newsletter
Banners
 
Feedback
Tip Jar
 
 
 
 
 
 
 
 
Old Pages
 
Old Index
Site Map
What's New
 
Books
How To
Tips & Tricks
Tutorials
Stories
Performance
Essays
Links
Q & A
New in VB6
Free Stuff
Pictures
 
 
 
TitleFind the first CD drive letter
Keywordscd drive, drive, cd-rom
CategoriesWindows
 
Use the GetDriveType API function to check the types of drives A, B, C, etc. until you find a CD drive.
 
' Return the first CD-ROM drive letter.
' Return "" if we cannot find a CD drive.
Private Function FirstCDDrive() As String
Const ASC_A = 65
Const ASC_Z = ASC_A + 25

Dim i As Integer

    For i = ASC_A To ASC_Z
        If GetDriveType(Chr$(i) & ":\") = DRIVE_CDROM Then
            FirstCDDrive = Chr$(i)
            Exit For
        End If
    Next i
End Function
 
 
Copyright © 1997-2003 Rocky Mountain Computer Consulting, Inc.   All rights reserved.
  Updated