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

查看:32
本文介绍了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.

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.

您还可以选择重定向标准输入、标准输出和标准错误.

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

请参阅此处以获取完整的选项列表.

See here for a complete list of options.

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

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