views:

417

answers:

4

When the command prompt opens and then just closes really fast (because there isn't a pause line) is there a way to see what it just showed you?

+3  A: 

You can pipe the output to a file.

something.exe > c:\temp\output.txt

This works on the prompt and in the windows run dialog box.

joegtp
Grant Wagner
+1  A: 

Run the console application from the command line, that way the console window will not close after the execution.

Open cmd prompt,

type the program to run Ex.:

c:\> ipconfig /all

I should get more coffee in my system before answering.

CheGueVerra
+1  A: 

Enable "Quick Edit Mode" for all command prompts (use the Properties menu which you get when right clicking on the handle bar of the window).

Now, you can click in the window with the mouse and it will block.

[EDIT] This is more useful to stop a long running process so you can browse through the output because even if you can hit the window before it closes, chances are that the error hasn't been printed yet and your reflexes are too slow to do it a second time.

Aaron Digulla
That requires being able to click on the window between the time it prints its output and the time its window closes. If the command window "opens and then just closes really fast," as the questioner says, you'd have to have mighty fast reflexes. Even then, you might not get the last bit of output.
Rob Kennedy
+3  A: 

Not after the fact, no. Once it's gone, it's gone. If you have the luxury of being able to run it again (i.e., you know what program or command was executed), then you can use some of the other suggestions noted here, and then count on the output from your run being the same as it was in the previous run. Suggestions include running the command in an already-open console window, piping the output to a file so you can read it later, and running the program in a batch file that has the pause command afterward.

Rob Kennedy