The short answer is that this is not supported on Windows.
The longer answer:
If an executable is marked as a “Windows” (GUI) program rather than a “Console” program, then the process is created without any STDOUT or STDERR handles - so printf output is discarded. Furthermore when the “Windows” marked program is started from a command line the console does not block and wait for return – it just spins off a separate process and carries on.
(more information here: https://devblogs.microsoft.com/oldnewthing/?p=19643)
A workaround if you really need this, is to use “Git Bash” rather than the Windows Command Prompt.
Git Bash is currently included in Git for Windows: https://gitforwindows.org/
I believe this is not good. If the user just want to know the version of Audacity, it should be printed on the cmd and do not require that the user wait for the GUI to fully load and make some clicks to get this information. Maybe this is even worse if the user is using some scripting.
But thanks again, I just think this is just something that should be enabled on Windows.