Run, rundll32.exe shell32.dll`,Control_RunDLL mmsys.cpl`,`,1 ; Opens Recorder settings
Sleep, 100
WinWait, Sound,
IfWinNotActive, Sound, , WinActivate, Sound,
WinWaitActive, Sound,
Send, {DOWN 1}{ALTDOWN}p{ALTUP} ; Change the DOWN 1 to the position of your mic in the list.
WinWait, Microphone Properties,
IfWinNotActive, Microphone Properties, , WinActivate, Microphone Properties,
WinWaitActive, Microphone Properties,
Send, {SHIFTDOWN}{TAB 4}{SHIFTUP}{HOME}{ENTER} ; Enable device
;Send, {SHIFTDOWN}{TAB 4}{SHIFTUP}{END}{ENTER} ; Disable device
WinWait, Sound,
IfWinNotActive, Sound, , WinActivate, Sound,
WinWaitActive, Sound,
Send, {ALTDOWN}{F4}{ALTUP}
ExitAppThe {DOWN 1} needs to be adjusted to the position of the mic in the recording devices list in the Sound control panel, as mine is in position 2, I'd change it to {DOWN 2}.
The uncommented "Send, {SHIFTDOWN}{TAB 4}{SHIFTUP}{HOME}{ENTER}" line is for enabling the device. The commented line below is to disable. You'll probably want to compile an exe for each function. (Enable.exe/disable.exe)
I hope it's useful to someone.




