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

The ControlMyMonitor utility allows you to change and view the settings of your monitor from GUI and from command-line.
In order to set the brightness of your monitor from command-line, you can simply run the following command:
ControlMyMonitor.exe /SetValue Primary 10 80

The above command will set the brightness of your primary monitor to 80% (You can set any value between 0 and 100). The '10' number specifies the VCP Code of brightness. For every monitor setting there is a different VCP Code, for example: in order to set the contrast of your monitor, you have to use the '12' as the VCP Code instead of '10'.
If you want to increase or decrease the brightness of your monitor, relatively to the current birghtness, you can use the /ChangeValue command, for example:
ControlMyMonitor.exe /ChangeValue Primary 10 -5

The above command will decrease the brightness 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\Monitor0" 10 8

There is also an option to switch between 2 or more brightness values, by using the /SwitchValue command.
For example, the following command switches between 3 brightness values - 30%, 60%, and 90%:
ControlMyMonitor.exe /SwitchValue "\\.\DISPLAY1\Monitor0" 10 30 60 90

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.