my Computer configuration is
intel pentium IV processor
512 mb ram
samsung cd drive 52x
logitech keyboard
logitech mouse
40 GB hdd (seagate)
operating system is windows 2000
the problem is cd drive is automatically ejecting when working with my computer.
so please support....
Well if you are connected to the internet and that happens then you are likely infected with a trojan horse or something like that . Any way try running an antivirus as well as a trojan and spyware remover scan on your pc.
Same thing happened to me bro. Well, you might have a trojan, but the problem is probably with your drive.
You know that flat thing at the end of it? That's probably loose. Make sure it is clipped together (take it on and take it off again).
That white thing at the end that says "Cd burner/52x" stuff like that. That's usually loose. It's great for playing pranks
.
good luck man, hope this helps
.
iv had similarly problems before on several computers with the cd drivbe as well. the most likely problem is a trojan/virus/script-kid-prank-ware thats causing it. a scan with an antivirus app and a adware/spyware remover shopuld fix it.
if not, it may be a background program thats constantly trying to read from the cd drive
3rd option - check the ide cable/sata cable isnt loose; some drives (rarely) will either flash their status leds/spin up and down constantly/or open and close the tray when theirs a prob
There is a Trojan Horse called SUB7 that allows the sender too control your computer, and one of the thinngs that they can do is open and close the CD/DVD drive, there is a SUB7 remover, just google 'SUB7 Remover' and it will get rid of it from your computer.
i have the simple solution for this...
go to ur task manager
u can see a application running called Odiyan
go to ur process and end task the Rundll.exe and OSA.exe, it may have 3 or more times...
and delete it from the startup (osa.exe)
those solutions are for specific programs etc..
but cd drives can actually start playing up and do this on their own. not a software related thing like a trojan. I have several drives that just randomly do it and it could be during booting or anything, and it has happened on computers not connected to the internet so it isn't a virus issue in my case.
Thank you for your greate ideas and support 
WELL did you fix it? Geez 
There may be some cause.
If it is due to an malware (virus), then instal updated version of a good antivirus and scan your computer thoroughly. If you are using an antivirus and not getting any virus, then update it.
Samsung drives show this problem called, as tray problem. If it is in warranty, go to your vendor other wise tight some screws which is releed to tray.