in reply to How to check to see if a CD drive is a writable on windows?

Try this. I don't have a writable CD on this system to check what the output would be, but it should be something like CD-R or CD-RW etc. for writable media.

>c:\windows\system32\wbem\wmic.exe cdrom get mediatype MediaType CD-ROM

You'll need to look at the options for how to get the information for multiple CD drives.

You can then chose to just extract the results from running the exe, or you could use the Win32::OLE to access WMI scripting interface, my $locator = Win32::OLE->new ('WbemScripting.SWbemLocator');.

See Win32::Process::Info for some example code for doing the latter.


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
The "good enough" maybe good enough for the now, and perfection maybe unobtainable, but that should not preclude us from striving for perfection, when time, circumstance or desire allow.

Replies are listed 'Best First'.
Re^2: How to check to see if a CD drive is a writable on windows?
by swampyankee (Parson) on Oct 04, 2005 at 02:06 UTC

    Thank you!

    wmic cdrom get

    seems to provide the information I need.

    I usually rtfm but I find MS's more difficult to get information from than IBM's shelf-o-books.

    emc