Microsoft Windows already have the option to eject the drive tray, but an option to close the drive would make things more easier. Follow the steps below to add the close tray option to the right-click context menu.
1. Download Nircmd.zip from Nirsoft.net, unzip and extract the files to a folder. Move the file nircmd.exe to your Windows directory.
2. Download closetray.zip and save to Desktop.
3. Unzip the files and extract the contents to a folder.
4. Double-click closetray.reg to run it.
Note:Nircmd can automate many tasks, read the help file.