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

あなたが欲しい:

dir> a.txt 2>&1
構文2>&1は、2(stderr)を1(stdout)にリダイレクトします。NULにリダイレクトしてメッセージを非表示にすることもできます。MSDNの説明と例を参照してください。

おすすめ

転載: www.cnblogs.com/cutepig/p/12690666.html