Determine the height and width of the terminal, and store this information into variables for subsequent use.

@echo off
 
for /f "tokens=1,2 delims= " %%A in ('mode con') do (
	if "%%A"=="Lines:" set line=%%B
	if "%%A"=="Columns:" set cols=%%B
)
 
echo Lines: %line%
echo Columns: %cols%
exit /b 0