Powershell – check if a CD is in CD-ROM drive

Question:

Is this possible?

My first guess would be something like:

C:> Get-WmiObject Win32_CDROMDrive

But when I tried this, it only tells me Caption, Drive, Manufacturer,VolumeName

No information on whether or not there is a CD in the disc drive.

Answer:

You can get this information by

You can see what properties are available for that WMI class by

and more detailed documentation from

In general, you will find that liberal use of the Get-Help, Get-Member, Get-Command, and Get-WMIHelp cmdlets will provide you with a great deal of information, and possibly eliminate the need to ask questions like this here and wait for an answer that may or may not come.

Source:

Powershell – check if a CD is in CD-ROM drive by licensed under CC BY-SA | With most appropriate answer!

Leave a Reply