avatar
Igor Brejc

Redirecting both standard output and errors to a file in Windows

How to redirect both standard output and errors to the same file in Windows.

Tue 04 February 2020
Tweet

Most of you know the classic redirect syntax:

myprogram > output.txt

But this does not capture error messages, which still end up in the console. In order to capture those, too, you need this:

myprogram 1> output.txt 2>&1

Source: Redirecting Error Messages from Command Prompt: STDERR/STDOUT

cmd-exetips
Tweet
Scalable
Maps
Royalty-free, high-quality editable vector maps of the world in SVG and Adobe Illustrator formats
Igor Brejc
© 2019-2023
Published with Pelican v4.8.0
Last updated on 2023-01-16 17:38:38