3

I'm using the NirCmd utility to set the audio volume via the command prompt for a game but need to know what the current volume is upon the app start up.

I found this question: Change Windows sound volume via the command line which also mentions NirCmd but doesn't mention how to use it to get the current volume.

I've tried getvol master, but I get the error getvol is not recognized.

How can I get the current audio volume either using native Windows commands or NirCmd?

Cameron
  • 185

1 Answers1

4

Ideally you would use the same .Net or Win API that tools like NirCmd are using to do this directly.

I have also been struggling to find a good and simple command line option to get the current system volume.

I finally found something that works on Windows 10.

I haven't tried older versions of windows yet, but I presume it works for Windows Vista or later.

It is available here: https://sourceforge.net/projects/mplayer-edl/files/adjust_get_current_system_volume_vista_plus.exe/download

Usage:

adjust_get_current_system_volume_vista_plus.exe

returns the current volume and exits

adjust_get_current_system_volume_vista_plus.exe 50

sets the volume to 50 then returns the current volume (50) and exits.


There is also a python option here: https://github.com/AndreMiras/pycaw


It should be possible to do this with PowerShell as well: https://stackoverflow.com/a/19348221/861745

jgstew
  • 53