Function FindCDROMDriveWithMedia
' Returns an array of CD ROM drives
' the have a CD in them
Dim fso : Set fso = CreateObject("Scripting.FileSystemObject")
Dim d, dc, aResult
ReDim aResult(-1)
Set dc = fso.Drives
For Each d in dc
If d.DriveType = 4 Then
If d.IsReady
then
ReDim Preserve aResult(UBound(aResult)+1)
aResult(UBound(aResult)) = d
End if
End if
Next
FindCDROMDriveWithMedia= aResult
End Function