执行批处理脚本时保存到日志/文本文件 [英] Save to log/text file while executing the batch script

查看:1977
本文介绍了执行批处理脚本时保存到日志/文本文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我想知道如何能够提出一个条件,如果我执行我的批处理文件,所有正在运行的进程/输出应该有看到控制台窗口并将其保存到我的日志文件中(执行时)。

实际上,我试图使用>>保存输出,它确实有效,但是,我无法在控制台窗口中看到运行输出..我想看到两个..



提前谢谢

Hi Everyone,

I want to know How I can able to put a condition wherein if I execute my batch file all the running process/output should have in seen the console window and keeping it save to my logfile (while executing).
Actually, I tried to use the ">>" to save the output and it really works, however, I cannot able to see the running output in console window.. I want to see both..

Thanks in advance

推荐答案

您可以尝试以下方法查看它是否适合您



创建CombinedBatchFile.bat并在其中保存以下两行

Well you can try below approach to see whether it works for you

create CombinedBatchFile.bat and save below two lines in it
call yourBatchFile.bat > dump.txt
type dump.txt





并运行CombinedBatchFile.bat。虽然这不是实时的,但应该符合你的目的。



And run CombinedBatchFile.bat. Though this wont be in real time but should serve your purpose.


这篇关于执行批处理脚本时保存到日志/文本文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆