I have a Qt GUI application running on Windows that allows command-line options to be passed and under some circumstances I want to output a message to the console and then
One solution is to run powershell and redirect the output to whatever stream you want.
Below is an example of running powershell from cmd.exe and redirecting my_exec.exe output to both the console and an output.txt file:
powershell ".\my_exec.exe | tee output.txt"