How to close CD/DVD tray using command line on Windows laptop
I hope I have the right part of this forum for my question.
I have two Windows 7 laptops, and I have been trying to find out if there is a windows function that I can use to close the DVD tray on these laptops. My wife's laptop's DVD tray comes open occasionally all on it's own, without any apparent prompting, and I would like a command that I can send to windows to close the tray without doing it physically. Of course, if I knew what was causing the tray to open without our prompting to begin with, I would not need such a close command for the DVD tray. Any help would be appreciated.
There is no built-in tool in Windows OS to close the DVD/CD tray using the command, but you can download a third party utility called nircmd.exe from nirsoft.net and use it for this purpose.
NirCmd can add Open & Close CD/DVD Tray to Context Menu
Right-click on the desktop.
Select New -> Shortcut.
In the text box that appears, type: C:\Windows\nircmd.exe cdrom open <CD drive letter:> and click Next. ...
Give a name to the shortcut and click OK to close the shortcut wizard.