0

Is there any way to save whole cmd.exe output to the specified file?

I can't just use the redirection operators (>, >> etc) cause the application I'm working with launches child processes and these operators doesn't affect them.

  • Have you seen/tried this yet? How to quickly save what is currently shown in cmd.exe to a file – Ƭᴇcʜιᴇ007 Jun 24 '16 at 17:15
  • @Ƭᴇcʜιᴇ007 Unfortunately, we need to save this information to the file in streaming manner. So we don't want to take snapshots after certain period of time, we need to redirect output constantly – FrozenHeart Jun 24 '16 at 17:20
  • 2
    If the children are normal console apps, they will inherit the standard paths from their parent, and will be subject to the same redirection. If they open their own paths for console I/O, these cannot be redirected. – AFH Jun 24 '16 at 17:20
  • @AFH "If they open their own paths for console I/O" -- what do you mean? By the way, standard way with using rediretion operators doesn't work in my case – FrozenHeart Jun 24 '16 at 17:23
  • 1
    There is STDIn, STDOut and STDErr, these are the "standard" I/O paths to/from the console. Redirection works by using these; if they don't work, then that means the process is using some non-standard way to direct output to the terminal, so there's probably no 'standard' way to capture that output. Have you checked to see if the output being put out by those sub-processes are perhaps coming through StdErr (2) instead of StdOut (1)? Perhaps you just need to (also) redirect StdOut... – Ƭᴇcʜιᴇ007 Jun 24 '16 at 17:30

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.