问题:
I'm trying to redirect all output (stdout + stderr) of a DOS command to a single file: 我正在尝试将DOS命令的所有输出(stdout + stderr)重定向到单个文件:
C:\>dir 1> a.txt 2> a.txt
The process cannot access the file because it is being used by another process.
Is it possible, or should I just redirect to two separate files? 是可能的,还是应该重定向到两个单独的文件?
解决方案:
参考一: https://stackoom.com/question/5xen/将Windows-cmd标准输出和stderr重定向到单个文件参考二: https://oldbug.net/q/5xen/Redirect-Windows-cmd-stdout-and-stderr-to-a-single-file
来源:oschina
链接:https://my.oschina.net/stackoom/blog/4355200