<p>I'm trying to create a deployment tool that will install software based on the hardware found on a system. I'd like the tool to be able to determine if the optical drive is a writer (to determine if burning software sould be installed) or can read DVDs (to determine if a player should be installed). I tried uing the following code </p>

<pre><code>strComputer = "."
Set objWMIService = GetObject("winmgmts:\\" &amp; strComputer &amp; "\root\cimv2")
Set colItems = objWMIService.ExecQuery("Select * from Win32_CDROMDrive")
For Each objItem in colItems
    Wscript.Echo "MediaType: " &amp; objItem.MediaType
Next
</code></pre>

<p>but it always respons with CD-ROM</p>

You can use WMI to enumerate what Windows knows about a drive; get the
```
Win32_DiskDrive
```
instance from which you should be able to grab the the
```
Win32_PhysicalMedia
```
information for the physical media the drive uses; the
MediaType
property to get what media it uses (CD, CDRW, DVD, DVDRW, etc, etc).