I have test c++ console application which require administrative rights and produce output to console using std::cout << "log"
I am launching this application from test.bat with following content testconsoleapp.exe > test.log EXIT %ERRORLEVEL%
and test.bat was started by virtualbox vboxmanage.exe guestcontrol .. run --wait-stdout --wait-stderr test.bat
And my test.log is empty when I am using function AttachConsole(ATTACH_PARENT_PROCESS)
Current solution is to specify filename for console application and write to file instead of std::cout, but may be there is an easy way