If you’re in a situation where your console output text is being truncated because so many lines have been output, you may want to increase the limit.
Increase Windows Console Text Limit
- With a console window already spawned, right click the top and go to properties:
![](https://alexanderhoughton.co.uk/wp-content/uploads/2023/03/image-1024x595.png)
- Increase the Screen Buffer Size Height. You will be limited to 9999 lines maximum. See the section below for modifying this value programmatically to go beyond this limit.
![](https://alexanderhoughton.co.uk/wp-content/uploads/2023/03/image-1.png)
Increase Windows Console Text Limit Programmatically via C/C++
You can achieve the equivalent of the above programmatically by calling SetConsoleScreenBufferSize. While it accepts a SHRT_MAX value of 32767, in reality I found the limit on my PC to be 16384 before the console started to truncate text
#include <windows.h>
COORD c = { 120, SHRT_MAX }; SetConsoleScreenBufferSize(GetStdHandle(STD_OUTPUT_HANDLE), c);
Alternatives: Redirect IO to a file
When executing programs from the command line, you can redirect the output into a file by appending “> FileName” to the end of the command. To give an example, to redirect the output from ipconfig to a text file called MyFile.txt you can do as follows:
ipconfig > MyFile.Txt