Powered by GeSHi

Source code for cdeject.vbs

(view source code of cdeject.vbs as plain text)

  1. ' CDEject.vbs, Version 1.00
  2. ' Eject all CDROMs
  3. '
  4. ' Needs Windows Media Player installed
  5. '
  6. ' Script posted by Christoph Fricke on the
  7. ' microsoft.public.de.german.scripting.wsh
  8. ' newsgroup
  9.  
  10. Set oWMP = CreateObject("WMPlayer.OCX.7")
  11. Set colCDROMs = oWMP.cdromCollection
  12.  
  13. if colCDROMs.Count >= 1 then
  14.     For i = 0 to colCDROMs.Count - 1
  15.         colCDROMs.Item(i).Eject
  16.     Next  ' cdrom
  17. End If
  18.