Retrieves a type of the media which is loaded into a specified CD-ROM device
#include <WinAPIFiles.au3>
_WinAPI_GetCDType ( $sDrive )
$sDrive | The drive letter of the CD tray to retrieve information, in the format D:, E:, etc. |
Success: | The type of the media, it must be one of the following values. 0x0000 - No media 0x0008 - CD-ROM 0x0009 - CD-R 0x000A - CD-RW 0x0010 - DVD-ROM 0x0011 - DVD-R Sequential Recording 0x0012 - DVD-RAM 0x0013 - DVD-RW Restricted Overwrite 0x0014 - DVD-RW Sequential Recording 0x0015 - DVD-R Dual Layer 0x0016 - DVD-R Dual Layer Jump Recording 0x0017 - DVD-RW Dual Layer 0x0018 - DVD-Download Disc Recording 0x001A - DVD+RW 0x001B - DVD+R 0x0040 - BD-ROM 0x0041 - BD-R Sequential Recording Mode (SRM) 0x0042 - BD-R Random Recording Mode (RRM) 0x0043 - BD-RE 0x0050 - HD DVD-ROM 0x0051 - HD DVD-R 0x0052 - HD DVD-RAM 0x0053 - HD DVD-RW 0x0058 - HD DVD-R Dual Layer 0x005A - HD DVD-RW Dual Layer 0xFFFF - Unknown |
Failure: | 0 and sets the @error flag to non-zero. |
Search IOCTL_SCSI_PASS_THROUGH in MSDN Library.
#include <WinAPIFiles.au3>
Local $sText, $iType, $aDrive = DriveGetDrive('CDROM')
If IsArray($aDrive) Then
For $i = 1 To $aDrive[0]
$sText = 'Unknown'
$iType = _WinAPI_GetCDType($aDrive[$i])
If Not @error Then
Switch $iType
Case 0x0000
$sText = 'No media'
Case 0x0008
$sText = 'CD-ROM'
Case 0x0009
$sText = 'CD-R'
Case 0x000A
$sText = 'CD-RW'
Case 0x0010
$sText = 'DVD-ROM'
Case 0x0011
$sText = 'DVD-R SR'
Case 0x0012
$sText = 'DVD-RAM'
Case 0x0013
$sText = 'DVD-RW RO'
Case 0x0014
$sText = 'DVD-RW SR'
Case 0x0015
$sText = 'DVD-R DL'
Case 0x0016
$sText = 'DVD-R DL JR'
Case 0x0017
$sText = 'DVD-RW DL'
Case 0x0018
$sText = 'DVD-DDR'
Case 0x001A
$sText = 'DVD+RW'
Case 0x001B
$sText = 'DVD+R'
Case 0x0040
$sText = 'BD-ROM'
Case 0x0041
$sText = 'BD-R SRM'
Case 0x0042
$sText = 'BD-R RRM'
Case 0x0043
$sText = 'BD-RE'
Case 0x0050
$sText = 'HD DVD-ROM'
Case 0x0051
$sText = 'HD DVD-R'
Case 0x0052
$sText = 'HD DVD-RAM'
Case 0x0053
$sText = 'HD DVD-RW'
Case 0x0058
$sText = 'HD DVD-R DL'
Case 0x005A
$sText = 'HD DVD-RW DL'
EndSwitch
EndIf
ConsoleWrite(StringUpper($aDrive[$i]) & ' => ' & $sText & @CRLF)
Next
EndIf