This VBS Script combines the textToSpeech script with the openCDtray script. The computer will say "This is your computer speaking. I'm hungry for a CD." Then the cd tray will open for four seconds then close. 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.


  2. Set oWMP = CreateObject("WMPlayer.OCX.7" )
  3. Set colCDROMs = oWMP.cdromCollection
  4. Dim var1
  6. var1 = "This is your computer speaking, I'm hungry for a CD."
  7. set sapi = wscript.createobject("SAPI.Spvoice")
  8. Sapi.speak var1 'this line tells the computer to speak the text in the variable var1'
  10. colCDROMs.Item(1).Eject 'open cd tray'
  11. WScript.Sleep 4000 'wait 4 seconds'
  12. colCDROMs.Item(1).Eject 'close cd tray'