Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

determining if a blank cd or cd-r or is in a drive

2 views
Skip to first unread message

Matthe...@gmail.com

unread,
Nov 19, 2005, 6:30:37 PM11/19/05
to
So, I'm trying to figure out what to query in WMI to find out if there
is a blank CD in the drive.

I've tried almost all the properties for both Win32_CDROMDrive and
Win32_DiskDrive with no luck. Win32_PhysicalMedia could be my savoir,
but I can get it to work.


I read that Win32_CDROMDrive isn't fully supported by all drives yet,
and also isn't supported by WMI yet; but I'm hoping someone can help
me.

Noting that .MediaLoaded returns 0 when a blank CD is inserted (or when
there's no CD), take a look at the following:

Set colItems = objWMIService.ExecQuery("Select * from
Win32_CDROMDrive")
For Each objitem in colItems
if objitem.MediaLoaded = 0 AND [MAGICAL PROPERTY GOES HERE]then
wscript.echo "YEY"
end if
next

Any help would be appreciated.

Thanks,

MAtt

0 new messages