If you wish to enumerate all the CD's on the system (remember, there can be,
and frequently are, more than one CD in systems now-a-days), consider the
following:
Private Declare Function GetDriveType Lib "kernel32" _
Alias "GetDriveTypeA" _
(ByVal sDrive As String) As Long
Private Sub Command1_Click()
On Error Resume Next
For x = Asc("c") To Asc("z")
If GetDriveType(Chr$(x) & ":") = 5 Then
Debug.Print Chr$(x)
End If
Next
End Sub
where the above is pasted into a Form's code window, clicking a
CommandButton named Command1 is assumed to kick off the code and where you
will replace the Debug.Print with whatever code you actually need.
In case you want to expand upon the above, the possible Return Values from
the GetDriveType function are:
2 Removable Disk Drive
3 Fixed Hard Disk Drive
4 Network Drive
5 CD ROM Drive
6 Ram Disk
Rick
Hi...I want to find the path of a CD containing jpeg files after the user
has
intalled the program on a remote machine, however this CD rom drive letter
could be "D E F" or
what ever the user has set this drive letter to be.
The program I have written with VB6 needs to be able to find this drive and
path after the
user has clicked on a lable that will direct them to a jpeg file on this
unknown cd rom drive letter.
thanks.....Rob