Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

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

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

To send the output to the clipboard append | clip.

Ex: ping | clip


From my clipboard:

Pinging [] 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
    Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
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

Besides redirection, you can also increase the buffer size of the command prompt. Details are explained here:

  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.
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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.