Windows – Is it possible to eject a cd in a batch file on Windows XP

batchcompact-discejectwindows xp

I've seen a few executables/utilities that do it, and many forums that say it is not possible to do. But is there any DOS command that I can rely on in a typical XP installation?

Best Answer

There seems to be no way using rundll or a preexisting executable.

If you have windows scripting host installed, maybe the following helps (untested, copied from another forum)

Set oWMP = CreateObject("WMPlayer.OCX.7")
Set colCDROMs = oWMP.cdromCollection

Change the (0) if you have more than one drive.