Windows命令提示符日志到文件 [英] Windows command prompt log to a file

查看:635
本文介绍了Windows命令提示符日志到文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想轻松地将Windows命令提示符的日志保存到文件中。是否有其他选择可以选择所有内容并右键单击副本?

I'd like to easily save the log of the Windows command prompt into a file. Is there any alternative to select everything and right-click on copy?

推荐答案

您可以将cmd提示符的输出重定向到使用> 附加到文件的文件。

You can redirect the output of a cmd prompt to a file using > or >> to append to a file.

ie

echo Hello World >C:\output.txt
echo Hello again! >>C:\output.txt

mybatchfile.bat >C:\output.txt

请注意,使用> 将自动覆盖该文件(如果已存在)。

Note that using > will automatically overwrite the file if it already exists.

您还可以选择重定向stdin,stdout和stderr。

You also have the option of redirecting stdin, stdout and stderr.

请参见此处获取完整的选项列表。

See here for a complete list of options.

这篇关于Windows命令提示符日志到文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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