How to capture stderr on Windows/DOS?

后端 未结 2 1925
情歌与酒
情歌与酒 2020-12-13 13:23

I want to capture the errors from a script into a file instead of to the screen.

In *nix, this is done with stderr redirection, usually

echo \"Error\         


        
2条回答
  •  猫巷女王i
    2020-12-13 13:56

    For example:

    PSKILL NOTEPAD >output.txt 2>&1
    

    This will direct stdout and stderr to a file name output.txt.

    See Underused features of Windows batch files for more details.

提交回复
热议问题