I use this routine
FUNCTION DiskReady% (d$)
'returns: 0 if drive exists and it's ready
' 1 if drive is not ready
' 2 if drive does not exist
' 3 if drive exists and disk is an audio CD
'
'Tested in Win 95/98 and DOS 6.2
'detects RAM disks and it's supposed to detect network units
'Does not use interrupt calls!
'-----------------------------------------------------------'To use it into your programs simply copy it and add the line
' diskreadyerror: errata% = ERR: RESUME NEXT
'(without the leading ') after the END of the main program
'-----------------------------------------------------------
SHARED errata%
errata% = 0
drive$ = LEFT$(UCASE$(d$), 1) + ":"
IF drive$ = "B:" THEN
OUT &H70, &H10
IF (INP(&H71) AND 7) = 0 THEN DiskReady% = 2: EXIT FUNCTION
END IF
ON ERROR GOTO diskreadyerror
num% = FREEFILE
OPEN drive$ + "\track01.cda" FOR INPUT AS #num%
SELECT CASE errata%
CASE 53: DiskReady% = 0
CASE 71: DiskReady% = 1
CASE 76: DiskReady% = 2
CASE 0: DiskReady% = 3: CLOSE num%
CASE ELSE
PRINT "Unexpected error value "; errata%; "in Diskready function": END
END SELECT
ON ERROR GOTO 0
end function Antoni