i really need this code

how do i check to see if the cdrom door is open and if so close it

please help???????