Eject a CD/DVD Drive with Powershell
Submitted by justin on Fri, 02/11/2011 - 09:05
Here's a quick Powershell script to eject all CD/DVD drives on a computer. This uses the WMPlayer COM object.
$wm = New-Object -ComObject "WMPlayer.ocx"
$drives = $wm.cdromCollection
for($i = 0; $i -lt $drives.Count; $i++)
Feedback is always welcome. Enjoy!