Skip to content

Instantly share code, notes, and snippets.

@osbornm
Created March 30, 2015 13:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save osbornm/1130cfc713b315546dba to your computer and use it in GitHub Desktop.
Save osbornm/1130cfc713b315546dba to your computer and use it in GitHub Desktop.
$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