CMD: Export all the screen content to a text file

2019-03-08 14:24发布

In command prompt - How do I export all the content of the screen to a text file(basically a copy command, just not by using right-clicking and the clipboard)

This command works, but only for the commands you executed, not the actual output as well

doskey /HISTORY > history.txt

7条回答
三岁会撩人
2楼-- · 2019-03-08 15:14

If you want to output ALL verbosity, not just stdout. But also any printf statements made by the program, any warnings, infos, etc, you have to add 2>&1 at the end of the command line.

In your case, the command will be

Program.exe > file.txt 2>&1

查看更多
登录 后发表回答