Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Finding drive letter of CD ROM

sumedhsumedh Member Posts: 103
hi everybody,

how do i find the letter assigned to the CD-ROM drive on a person's PC...??

tks. for any help
-sumedh

P.S. - Tks. david, the application launching code worked gr8!!

Comments

  • KDivad LeahcimKDivad Leahcim Member Posts: 3,948
    : hi everybody,
    :
    : how do i find the letter assigned to the CD-ROM drive on a person's PC...??
    :
    : tks. for any help
    : -sumedh
    :
    : P.S. - Tks. david, the application launching code worked gr8!!
    :

    Have never used them, but you can try this:

    Declare Function GetDriveType Lib "kernel32" Alias "GetDriveTypeA" (ByVal nDrive As String) As Long
    Declare Function GetLogicalDriveStrings Lib "kernel32" Alias "GetLogicalDriveStringsA" (ByVal nBufferLength As Long, ByVal lpBuffer As String) As Long

    Make a string long enough (255 would be plenty) and pass the string and it's length to GetLogicalDriveStrings. Parse it (it's basically c:d:). Pass each piece to GetDriveType one at a time until it returns 5. I think 5 is CD anyway...
Sign In or Register to comment.