If your exe application is directly displaying it's output to command window, use output redirection operator within system() command as in:
-
system("tool.exe >> result.txt");
-
If your tool expects some user input, then you would need the display to appear both on command console as well as log file. Try using:
-
open(STDOUT, "| tee result.txt STDOUT");
-
system("tool.exe >> result.txt");
-
close (STDOUT) ;
-
-Nithin