' A script example showing the use of the WMPlayer object ' to eject (open) all CDROM drawers. ' ' Found in microsoft.public.scripting.vbscript ' On Error Resume Next Set oWMP = CreateObject("WMPlayer.OCX") Do Set colCDROMs = oWMP.cdromCollection if colCDROMs.Count >= 1 then For i = 0 to colCDROMs.Count - 1 ' Next line for demo, only. wsh.echo "Opening", colCDROMs.Item(i).driveSpecifier colCDROMs.Item(i).Eject if Err.Number <> 0 Then Exit Do Next ' cdrom Else wsh.echo "No CDROM drive found." End If Loop Until True if Err.Number <> 0 Then wsh.echo "Sorry, this script requires WMPlayer version 7 or later." End if