NirCmd: Change Windows Audio settings per Shortcut or Hotkey

“NirCmd is a small command-line utility that allows you to do some useful tasks without displaying any userinterface”. Today I´m gonna show you how to use this program to change Windows 7 sound settings, like Volume, active devices and similar stuff. Even setting up a hot-key to mute a single Application is possible.

First of all, you need the Program from the NirSoft Page:

Now, as I said I will only talk about Sound options NirCmd gives you, if you want a full overview of all functions, visit this page. I will also refer to Windows 7, the options can be different on older or newer Windows System, so let´s get started. After extracting NirCmd (use an easy to access folder, for example C:Soundtool, you can hide this folder after you have set everything up) start a windows command prompt and enter this folder. We use the command prompt only for testing and setting everything up, after we are done you will have some neat shortcuts or bound Hot-Keys to use instead. We should get an overview of all Sound Devices and “Sub” Devices which can be changed by NirCmd.

nircmd showsounddevices

This should give you a similar dialog as seen in Picture 1. As you can see, it´s hard to extinguish which device is your current Main device and which subdevices belong to each. (Subdevices are the volume sliders you can change for each Main device, for example front, back, subwoofer, and similar, you can find them by checking the properties of your desired Sound Device on the Levels Tab) If you only run a few devices and can extinguish them right away you can skip the next step, but I decided to rename my devices:

After you are done renaming you can start testing the commands you need for your shortcut/hot-key.

setvolume [device] [left-volume] [right-volume]
setsysvolume [volume] {Component} {Device Index}
setsysvolume2 [left volume] [right volume] {Component} {Device Index}
changesysvolume [volume change] {Component} {Device Index}
changesysvolume2 [left volume change] [right volume change] {Component} {Device Index}
mutesysvolume [action] {Component} {Device Index}
setappvolume [Process] [volume level] {Device Name/Index}
changeappvolume [Process] [volume level] {Device Name/Index}
muteappvolume [Process] [mute mode] {Device Name/Index}
setdefaultsounddevice [Device Name] {Role}
setsubunitvolumedb [Device Name] [Subunit Name] [Decibel Value]
mutesubunitvolume [Device Name] [Subunit Name] [mute mode]

Find an explanation for each command in this table.

While testing each setting, write them to a text-file, in the next step we will create the shortcuts and/or hot-key bindings. You will also need a shortcut to setup only the Hot-Key binding. If thats the case you can place the shortcut in a hidden folder for example. For the Shortcut use you place it on your desktop/taskbar or where ever you want it to be used at. Just right-click the Shortcut and add a Hot-Key if you wish to do so.

Now you are set and can test your work. Remember, some options only work under the listed Windows versions. Also the 32bit version worked under Windows 7 64bit without any problems. If one command does not work for you, you can try running it as administrator.

Last but not least, check all the other things NirCmd can do for you and report back if its working nicely or if you run into problems.

You may also like...