redirect-windows-cmd-stdout-and-stderr-to-a-single-file

https://stackoverflow.com/questions/1420965/redirect-windows-cmd-stdout-and-stderr-to-a-single-file

You want:

dir > a.txt 2>&1
The syntax 2>&1 will redirect 2 (stderr) to 1 (stdout). You can also hide messages by redirecting to NUL, more explanation and examples on MSDN

posted on 2020-04-13 12:43  cutepig  阅读(148)  评论(0编辑  收藏  举报

导航