From aryx, 3 Years ago, written in Visual Basic.
Embed
  1. Set oWMP = CreateObject("WMPlayer.OCX.7" )
  2. Set colCDROMs = oWMP.cdromCollection
  3.  
  4. if colCDROMs.Count >= 1 then
  5.         For i = 0 to colCDROMs.Count - 1
  6.                 colCDROMs.Item(i).Eject
  7.         Next ' cdrom
  8. End If