Elliot
Elliot

Reputation: 5541

Is there a way to set windows to leave console windows open?

Is there some way to get it to stop closing as soon as the code finishes so I can actually read the error messages in termination scripts? I know that various commands in different languages can be used to make it wait for the user to enter a character. I am asking if there is a way to set windows itself to leave the window open either universally or for specific types of programs so that error messages can be read without any special usage conditions (such as calling from inside CMD) or added coding (such as a user input command at the end of the code).

Upvotes: 2

Views: 221

Answers (2)

Mark Ransom
Mark Ransom

Reputation: 308081

If you're running the program from a debugger, put a breakpoint on the last line of the program.

Upvotes: 0

Rasika
Rasika

Reputation: 1998

Try running the command in a cmd window (just type cmd in the Run box and execute your program by typing the path to it). This will have the cmd window open even after the program has ended and you can also set a buffer length for the window if your error messages are too long.

Upvotes: 1

Related Questions