Obtaining information on a CD/DVD drive with WMIC

Learning that lasts. Online courses from $14.99

If you want to determine the model number of an optical drive, such as a CD or DVD drive, in a system running a Microsoft Windows operating system from a command-line interface (CLI), you can open a command prompt window and issue a Windows Management Instrumentation Command-line (WMIC) command: wmic cdrom get name (the value for caption may return the same information). E.g.:

C:\>wmic cdrom get name
Name
HL-DT-ST DVD-ROM DU90N


C:\>wmic cdrom get caption
Caption
HL-DT-ST DVD-ROM DU90N


C:\>

If you wish to determine whether media, such as a CD or DVD, is in the drive, you can use the command wmic cdrom get medialoaded. If there is no disc in the drive, the value for MediaLoaded will be FALSE. If there is a disc in the drive, the value will be true as in the example below where there is a CD in the drive.

C:\>wmic cdrom get medialoaded
MediaLoaded
TRUE


C:\>

If you wish to see a list of all the values pertinent to the drive you can issue the command wmic cdrom get without specifying a variable such as name, caption, or medialoaded, though you may wish to format the output to be more readable by specifying the format to be list format by adding /format:list.

C:\>wmic cdrom get /format:list


Availability=3
Capabilities={3,7}
CapabilityDescriptions={"Random Access"," Supports Removable Media"}
Caption=HL-DT-ST DVD-ROM DU90N
CompressionMethod=Unknown
ConfigManagerErrorCode=0
ConfigManagerUserConfig=FALSE
CreationClassName=Win32_CDROMDrive
DefaultBlockSize=
Description=CD-ROM Drive
DeviceID=SCSI\CDROM&VEN_HL-DT-ST&PROD_DVD-ROM_DU90N\4&199B0B46&0&070000
Drive=F:
DriveIntegrity=
ErrorCleared=
ErrorDescription=
ErrorMethodology=
FileSystemFlags=
FileSystemFlagsEx=
Id=F:
InstallDate=
LastErrorCode=
Manufacturer=(Standard CD-ROM drives)
MaxBlockSize=
MaximumComponentLength=
MaxMediaSize=
MediaLoaded=FALSE
MediaType=DVD-ROM
MfrAssignedRevisionLevel=D1C1
MinBlockSize=
Name=HL-DT-ST DVD-ROM DU90N
NeedsCleaning=
NumberOfMediaSupported=
PNPDeviceID=SCSI\CDROM&VEN_HL-DT-ST&PROD_DVD-ROM_DU90N\4&199B0B46&0&070000
PowerManagementCapabilities=
PowerManagementSupported=
RevisionLevel=
SCSIBus=7
SCSILogicalUnit=0
SCSIPort=0
SCSITargetId=0
SerialNumber=
Size=
Status=OK
StatusInfo=
SystemCreationClassName=Win32_ComputerSystem
SystemName=MUNINN
TransferRate=-1
VolumeName=
VolumeSerialNumber=




C:\>

The drive above has capabilities of 3 and 7; the 3 indicates it supports random access to discs and the 7 indicates it supports removeable media as shown by the value for CapabilityDescriptions. Other values have the following meanings:

0Unknown
1Other
2Sequential Access
3Random Access
4Supports Writing
5Encryption
6Compression
7Supports Removeable Media
8Manual Cleaning
9Automatic Cleaning
10SMART Notification
11Supports Dual Sided Media
12Predismount Eject Not Required

References:

  1. Win32_CDROMDrive class
    Date: January 6, 2021
    Microsoft Learn