How to change the volume of your monitor speaker from command line on Windows operating system

The ControlMyMonitor utility allows you to change the settings of your monitor from command-line and GUI.
In order to set the speaker volume of your monitor from command-line, simply run the following command:
ControlMyMonitor.exe /SetValue Primary 62 40

The above command will set the speaker volume of your primary monitor to 40% (You can set any value between 0 and 100). The '62' number specifies the VCP Code of monitor speaker. For every monitor setting there is a different VCP Code.
If you want to increase or decrease the volume of the speaker , relatively to the current volume level, you can use the /ChangeValue command, for example:
ControlMyMonitor.exe /ChangeValue Primary 62 -5

The above command will decrease the speaker volume of your monitor by 5%.

If you have multiple monitors on your system, you have to specify the name or ID or serial number of the monitor you want to change, for example:
ControlMyMonitor.exe /ChangeValue "\\.\DISPLAY1\Monitor1" 62 10

Be aware that ControlMyMonitor will work on your system only if your hardware supports DDC/CI, and you have Windows Vista or later version of Windows (Including Windows 10). Windows XP is not supported.