If you need to eject a CD/DVD disk drive from a command line interface (CLI) there are a number of ways to do so. Three ways to do so from a command prompt on a Microsoft Windows system are included below.
Batch File
@echo off echo Set oWMP = CreateObject("WMPlayer.OCX.7") >> %temp%\temp.vbs echo Set colCDROMs = oWMP.cdromCollection >> %temp%\temp.vbs echo For i = 0 to colCDROMs.Count-1 >> %temp%\temp.vbs echo colCDROMs.Item(i).Eject >> %temp%\temp.vbs echo next >> %temp%\temp.vbs echo oWMP.close >> %temp%\temp.vbs %temp%\temp.vbs timeout /t 1 del %temp%\temp.vbs
[ More Info ]