3

I run an application via cmd; after it is done I want to select all text from the start, but cmd will not let me do that.

I already tried with Alt + Space and choice select all, and copy; however cmd just let me select all final text. The text is too big, and I can't scroll up fully.

How would I capture all output?

bertieb
  • 7,405
  • 1
    Try using [command] | clip or [command] >> [outputfilename].txt to select entire text generated from command to clipboard or a text file. – Tetsuya Yamamoto Apr 05 '17 at 09:58
  • @TetsuyaYamamoto this sounds like a perfect answer to me. Post it as an answer and you'll get an upvote from me. :) – LPChip Apr 05 '17 at 10:06
  • @TetsuyaYamamoto - This stops data being written to the screen, but the questioner wants to know how to capture what has already been written. To do this, type Ctrl-m to mark text, Ctrl-a to select all, and Enter to copy the selected text to the clip-board. Alternatively, if you select QuickEdit Mode in Properties -> Options, you can select with left-click and drag, and copy with right-click. – AFH Apr 05 '17 at 10:47

2 Answers2

3

You can use either piping to clip (copy to clipboard) or using stream to provide command output to a text file:

[command] | clip

[command] >> [outputfilename].txt

The first command copies entire command output to the clipboard which can be captured in Notepad or any other word-processors, and the second command generates stream which directly append to end of a text file if the file exists, or create a new file if the file name doesn't exist before then fill it with command output.

Update: If you want to display output in both CMD screen and outputting to text file simultaneously, use this way:

[command] >> [outputfilename].txt & type [outputfilename].txt

The type command reads all contents of the output file immediately after the command finished and display them as part of command line text.

NB: [command] is any recognizable command syntax you want to run with.

Further reference:

CMD: Export all the screen content to a text file

0

In a cmd.exe window you can right click, and select Mark.

Then with your mouse, you drag the selection on all the text you want copied, even the one outside the screen, while you are dragging, it will scroll up or down until you release the mouse button.

Once all the selection is done, you just press Enter, and all the selection will go straight to the Clipboard.

fernando.reyes
  • 968
  • 5
  • 16
  • i use window 10. don't need mark. my text file in cmd too big .i can't use mouse select copy method. have any way to copy text file? i sill wait my answer. – fastestsuperman Apr 05 '17 at 20:36