Aah, nice. Thank you.

This should be included in pywin32, don't you think so? (Or is it? I didn't
check before installing.)

Heiko

"Tim Golden" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
[Heiko Selber]
| I am trying to find out (using Python under windows) the name
| of a CD that
| is currently in the drive specified by a path name.
|
| And while I am at it, I'd also like to know whether the
| specified drive
| contains a CD at all, and whether the drive is actually a CD drive.

Try this:

<code>
import wmi

c = wmi.WMI ()
for i in c.Win32_CDROMDrive ():
  print i.Caption, i.VolumeName, i.VolumeSerialNumber

</code>

I haven't answered all your questions, but I'm willing
to bet that you can do pretty much what you want with
WMI.

There are also the pywin32 functions which give you some
of this (maybe all, don't know; haven't tried).

More info here: http://timgolden.me.uk/python/wmi.html
and here:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/win32_cdromdrive.asp
and here: http://pywin32.sf.net

TJG


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to