1

a variety on this question has been asked and answered https://stackoverflow.com/a/21709463/3906864

I followed the above linked answer and did the following

">log.txt"

that argument was added here

enter image description here

This allows the console output to be redirected from console to file, and the console window remains blank without anything displayed in it.

but i can't find a way to view the output in console while still simultaneously saving a copy to a txt file. any ideas ?

Community
  • 1
  • 1
InsaneBot
  • 2,422
  • 2
  • 19
  • 31
  • 1
    One way would be to write a 'tee' that replaces `cout` (or `cerr`). You can do this by writing you own `ostream` and `rdbuf` it. Tips [here](http://wordaligned.org/articles/cpp-streambufs) – sp2danny Oct 16 '15 at 17:18

1 Answers1

0

you need a version of tee. Powershell has Tee-Object (https://technet.microsoft.com/en-us/library/hh849937.aspx)

An example from link

get-process | tee-object -filepath C:\Test1\testfile2.txt

The above will output both to terminal and to the file

knightrider
  • 2,063
  • 1
  • 16
  • 29