Reading stdout/stderr output of Windows GUI apps

There are various solutions suggesting program.exe > output.txt or program.exe > output.txt 2>&1 to view stdout/stderr, but this doesn&apos;t seem to work for me. What worked for me is to use Git Bash or Cygwin Terminal to execute the EXE