Using Windows\' WMI library, how can I eject CD rom mounted in a specific CD/DVD drive?
I am asking for sources from WMI docs or examples since I am using wmi.py library
WMI itself doesn't provide means to eject CD/DVD drives. There're other solutions though, which involve using Windows API functions, for example:
Using the mciSendString function. Can't help you with the Python code, but here's the C# example to help you get the idea:
mciSendString("open f: type cdaudio alias cdrom", null, 0, IntPtr.Zero);
mciSendString("set cdrom door open", null, 0, IntPtr.Zero);
Using the DeviceIOControl function. An example (also in C#) is here.