Redirect Windows cmd stdout and stderr to a single file

前端 未结 7 1890
醉梦人生
醉梦人生 2020-11-22 10:11

I\'m trying to redirect all output (stdout + stderr) of a DOS command to a single file:

C:\\>dir 1> a.txt 2> a.txt
The process cannot access the fil         


        
7条回答
  •  时光说笑
    2020-11-22 10:35

    To add the stdout and stderr to the general logfile of a script:

    dir >> a.txt 2>&1
    

提交回复
热议问题