Created
March 30, 2015 13:29
-
-
Save osbornm/1130cfc713b315546dba to your computer and use it in GitHub Desktop.
This file contains hidden or 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
$cd = Add-Type -memberDefinition @" | |
[DllImport("winmm.dll", CharSet = CharSet.Ansi)] public static extern int mciSendStringA(string lpstrCommand, string lpstrReturnString, int uReturnLength, IntPtr hwndCallback); | |
"@ -passthru -name mciSendString\ | |
# Where F an G are the Drive letters | |
$cd::mciSendStringA("set cdaudio!F door closed wait", $null, 1, 1); | |
$cd::mciSendStringA("set cdaudio!G door closed wait", $null, 1, 1); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment