Quantcast
Channel: Digital Deviation - powershell
Viewing all articles
Browse latest Browse all 2

Eject a CD/DVD Drive with Powershell

$
0
0

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.cdromCollectionfor($i = 0; $i -lt $drives.Count; $i++){    $drives.Item($i).Eject()}

 

Feedback is always welcome.  Enjoy!


Viewing all articles
Browse latest Browse all 2

Latest Images

Trending Articles





Latest Images