Created
July 18, 2019 23:49
-
-
Save theTonyHo/de6806b7ca9b018edbe24f0f1cc59509 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
REM SOURCE: | |
REM http://stackoverflow.com/questions/19467792/batch-command-line-to-eject-cd-tray/28422571#28422571 | |
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment