Take the 2-minute tour ×

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?

share|improve this question
What are you missing and how are you copying it? Are you redirecting the program’s output or using the console’s mark-copy function? –  Synetech Nov 26 '12 at 2:35
I'm trying to copy it via Select All / Copy and it won't get it all since the history has been erased (or I can't see it when I scroll up). The problem with alot of answers is I'm compiling through visual studio, but I did not put that in my question :/ –  Howdy_McGee Nov 26 '12 at 2:37
Is your program outputting more than 999 lines? –  Synetech Nov 26 '12 at 2:39
No my program doesn't ouput nearly that many lines, but is probably only showing 100 lines, 150 tops. –  Howdy_McGee Nov 26 '12 at 2:45
So your program is printing ~100 lines and your command-prompt’s buffer is set to 999, but when you scroll up, it does not show all of the expected lines. Is that correct? Can you determine how many lines it does show and/or how many lines are missing? Maybe one of those numbers will look familiar (i.e., check the properties dialog for those numbers in one of the fields). Does the program clear the screen between printed “pages”? Try setting the console to the smallest prompt and the window to the largest width and height so that you can see more lines at a time to see if that has an effect. –  Synetech Nov 26 '12 at 3:15
show 1 more comment

4 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

share|improve this answer
add comment

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.

share|improve this answer
add comment

To send the output to the clipboard append | clip.

Ex: ping example.com | clip


From my clipboard:

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

Ping statistics for
Approximate round trip times in milli-seconds:
    Minimum = 16ms, Maximum = 103ms, Average = 52ms
share|improve this answer
I never knew that! +1 –  Canadian Luke Nov 26 '12 at 3:30
add comment

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
  3. Click the Options tab.
  6. Click the Layout tab.
  8. Do any of the following optional tasks:
    • In Screen Buffer Size, increase Width.
    • In Window Size, increase Height.
    • In Window Size, increase Width.

In the Note section

share|improve this answer
The Command History buffer size has nothing to do with how much information the window displays. It controls how many previously typed commands it will remember. Step 7, change the Screen Buffer Height, is the useful step there. –  Hand-E-Food Nov 26 '12 at 4:49
add comment

Your Answer


