Home > windows 7 > Copy Entire Command Prompt History

Copy Entire Command Prompt History

November 26Hits:1
Advertisement

So I'm running windows 7 and I have a long program that runs through command prompt and I need the output of it. I put my Buffer Size and Number of Buffers to 999 but I still am unable to get the entire history from when my program starts running. Suggestions on how maybe I can either print the history to a file or copy the whole thing?

Answers

Windows has something similar to the redirection operators in Linux.

The exact same syntax can be used:

progname > outputfile.txt

This will wipe the file of its old contents and fill it with the output of progname.

If you should need to append to the file (add more without wiping out the old contents), use the below syntax:

progname >> outputfile.txt

What you want is called "redirection", and can be done in any terminal/command prompt. Just use command_to_run > filename_to_save_into.

Also note that a double-arrow will append to a file, as in command_to_run >> filename_to_append_onto.

To send the output to the clipboard append | clip.

Ex: ping example.com | clip

Copy Entire Command Prompt History

From my clipboard:

Pinging example.com [192.0.43.10] with 32 bytes of data:
Reply from 192.0.43.10: bytes=32 time=70ms TTL=244
Reply from 192.0.43.10: bytes=32 time=103ms TTL=244
Reply from 192.0.43.10: bytes=32 time=16ms TTL=244
Reply from 192.0.43.10: bytes=32 time=19ms TTL=244

Ping statistics for 192.0.43.10:
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
    Minimum = 16ms, Maximum = 103ms, Average = 52ms

Besides redirection, you can also increase the buffer size of the command prompt. Details are explained here: http://technet.microsoft.com/en-us/library/bb491037.aspx

  1. Open Command Prompt
  2. Click the upper-left corner of the Command Prompt window, and then click Properties.
  3. Click the Options tab.
  4. In Command History, type or select 999 in Buffer Size, and then type or select 5 in Number of Buffers.
  5. In Edit Options, select the Quick Edit Mode and Insert Mode check boxes.
  6. Click the Layout tab.
  7. In Screen Buffer Size, type or select 2500 in Height.
  8. Do any of the following optional tasks:
    • In Screen Buffer Size, increase Width.
    • In Window Size, increase Height.
    • In Window Size, increase Width.
    • Clear the Let system position window check box, and then, in Window Position, change the values in Left and Top.
  9. In the Apply Properties dialog box, click Save properties for future windows with same title.

In the Note section

  • By increasing the screen buffer size to 999, you enable scrolling through the Command Prompt window.
  • By increasing the number of buffers to five, you increase the number of lines in the Command Prompt window to 5000.

Related Articles

Copyright (C) 2017 ceus-now.com, All Rights Reserved. webmaster#ceus-now.com 14 q. 0.635 s.