我正在尝试将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.
Run Code Online (Sandbox Code Playgroud)
是可能的,还是应该重定向到两个单独的文件?
Windows批处理文件有哪些鲜为人知但又重要且有用的功能?
指南:
澄清:我们在这里指的是由cmd.exe处理的脚本,这是WinNT变体的默认值.
(另请参阅:Windows批处理文件:.bat vs .cmd?)