更新时间:2023-12-05 20:27:10
如果你需要它仅适用于单行(输入),你可以写自己的发球批处理。
If you need it only for single lines (of input) you can write your own tee with batch.
@ECHO OFF
rem *** singleLineTee destination1 destination2
setlocal EnableDelayedExpansion
set /p var=
> %1 echo(!var!
> %2 echo(!var!
和以回声使用它打招呼| singleLineTee file1.log file2.log
编辑:同样作为一个单行
echo hello | ( cmd /v:on /c "set /p var=& >> file1.log echo !var!& >> file2.log echo !var!")
的 CMD / V:上/ C
必须启用延迟扩展