This VBS Script opens the CD tray on a computer, waits 4 seconds, then closes the CD tray. This program should run on any computer running microsoft windows version Windows 98 or newer.

There are more VBS Scripts on the VBS Scripts page.


openCDtray.vbs

  1.  
  2. Set oWMP = CreateObject("WMPlayer.OCX.7" )
  3. Set colCDROMs = oWMP.cdromCollection
  4.  
  5. colCDROMs.Item(1).Eject 'open cd tray'
  6. WScript.Sleep 4000 'wait 4 seconds'
  7. colCDROMs.Item(1).Eject 'close cd tray'
  8.