Created
November 3, 2017 19:07
-
-
Save jmac-slash0/73196eb3ccb0cb507cb1a372d9a3bd8b to your computer and use it in GitHub Desktop.
Call nircmd to change the current audio device
This file contains 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
Set WshShell = CreateObject("WScript.Shell") | |
cmds=WshShell.RUN("..\nircmd.exe setdefaultsounddevice ""Speakers"" 1", 0, True) ' Default Device | |
cmds=WshShell.RUN("..\nircmd.exe setdefaultsounddevice ""Speakers"" 2", 0, True) ' Default Communications Device | |
Set WshShell = Nothing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Install:
Usage:
Run activateSpeakers.vbs by double clicking on it, or by creating a shortcut that points to it and running that. For example, I have 2 copies of this script, one for my speakers and one for my headphones, with shortcuts for both.
Additional Reading:
http://www.microsoftnow.com/2013/05/creating-a-shortcut-to-change-the-default-audio-device-in-windows.html