Hello Forrester,
A device driver is a common cause for this kind of issue in Windows. Additional information can help me isolate your concern. Kindly answer the following:
- Did you notice any system setting changes prior to the issue?
- Have you installed the latest updates for Windows 10?
- Can you tell me the current OS Build of your Windows 10 system? Right-click the Start button, select System > About and then scroll down to Windows specifications to find this information.
As an initial troubleshooting, let's run the troubleshooting for hardware and devices. This diagnostic tool will scan your system for any issues detected with your device drivers and fix them for you. You need administrative permission to perform this operation.
- Right-click the Start button, select Settings > Update & Security > Troubleshoot.
- Select Hardware and Devices under Find and fix other problems.
- Click Run the troubleshooter.
- If prompted, choose Yes or enter the administrator password.
- Follow the on-screen instructions.
Software conflict is also a possible cause for the disc tray to keep on ejecting. You can perform a clean boot to determine if an installed program is causing it. This procedure will start your PC with a minimal set of drivers and startup programs. Follow the steps outlined in the section: How to perform a clean boot from this support article. For more details, you can watch our YouTube video.
IMPORTANT: Go to the section: Reset the computer to start normally after clean boot troubleshooting to boot the PC in normal startup after identifying the cause of the issue.
Should the issue continue, I suggest manually updating the driver for your optical disc drive. For the steps on how to perform this method in Windows 10, refer to Andre Da Costa's forum article. Follow the steps under the section: How to find and download drivers from the manufacturer's website.
Please respond to this thread to let me know how the issue progresses. Similarly, if you have more questions, please inform me by replying to this post.