A simple GUI script made with AutoIt (derived from my C++ snippet) ready to compile and run. This script was made to be assigned to a hot key or short cut.
#include <GUIConstantsEx.au3>
$drives = DriveGetDrive("CDROM")
If Not @error Then
CDTray("" & $drives[1], "open")
$driveopen = $drives[1]
Opt("GUIOnEventMode", 1)
$mwin = GUICreate("CD Tray", 340, 80)
GUISetOnEvent($GUI_EVENT_CLOSE, "CloseIt")
GUICtrlCreateLabel("CD Drive '" & $driveopen & "' is now open. Please place/remove disk and click OK.", 10, 10)
$okb = GUICtrlCreateButton("OK", 125, 45, 80, 23)
GUICtrlSetOnEvent($okb, "CloseIt")
GUISetState(@SW_SHOW)
EndIf
While 1
Sleep(1000)
WEnd
Func CloseIt()
CDTray("" & $drives[1], "close")
Exit
EndFunc