@ECHO OFF :: Check command line IF NOT [%1]==[] GOTO Syntax :: Store current screen size settings, using :: MODE CON command and temporary batch files. :: Columns: MODE CON | FIND /I "Columns:" > TEMP.BAT > COLUMNS.BAT ECHO SET Columns=%%1 CALL TEMP.BAT :: Lines: MODE CON | FIND /I "Lines:" > TEMP.BAT > LINES.BAT ECHO SET Lines=%%1 CALL TEMP.BAT :: Cleanup FOR %%A IN (COLUMNS LINES TEMP) DO IF EXIST %%A.BAT DEL %%A.BAT :: Note: the previous commands are based on MODE CON's screen output :: for English Windows versions as shown in the following lines: :: :: Status for device CON: :: ---------------------- :: Lines: 25 :: Columns: 80 :: Keyboard rate: 31 :: Keyboard delay: 1 :: Code page: 437 :: :: You may need to make FIND search for other strings :: than "s:" if you use a different language version. :: Done GOTO End :Syntax ECHO. ECHO ScrSzDOS.bat, Version 1.00 for MS-DOS ECHO Save current window size -- lines and columns -- in ECHO environment variables "Lines" and "Columns". ECHO. ECHO Usage: SCRSZDOS ECHO. ECHO Notes: Written for English MS-DOS versions only; can be ECHO adapted easily to other languages using this batch ECHO file's embedded comments. ECHO. ECHO Written by Rob van der Woude ECHO http://www.robvanderwoude.com :End