批处理文件日志记录问题 [英] Batch File Logging Issues
本文介绍了批处理文件日志记录问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何让一个批处理文件的日志,同时获得在屏幕上输出为好。
请注意我的批处理文件需要几个输入,以及,我试过的东西,但它不工作公平位,没有任何人有一些简单的解决方案?
解决方案
使用TEE技术。
:T恤<消息> <文件>
回声(1%
回声(%1>> 2%
退出/ B 0
使用这样
电话:三通这是我的消息日志并在屏幕上显示。 Output.txt的
替换您的回声
与命令调用:T恤
命令
how to get the logs of a batch file while getting the output on screen as well.
Note my batch file takes several input as well, I tried fair bit of things but its not working, does anyone have some simple solution ?
解决方案
Use a TEE technique.
:Tee <Message> <File>
echo(%1
echo(%1>>%2
exit /b 0
Use like this
call :Tee "This is my Message to display in the log and on screen." "Output.txt"
Replace your echo
commands with call :Tee
commands
这篇关于批处理文件日志记录问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文