Rob van der Woude's Scripting Pages
Powered by GeSHi

Source code for scrsznt.bat

(view source code of scrsznt.bat as plain text)

  1. @ECHO OFF
  2. :: Check command line parameters and Windows version
  3. IF NOT [%1]==[] GOTO Syntax
  4. IF NOT "%OS%"=="Windows_NT" GOTO Syntax
  5.  
  6. :: Store current screen size settings, using MODE CON command
  7. FOR /F "tokens=1,2 delims=: " %%A IN ('MODE CON ^| FIND "s:"') DO SET %%A=%%B
  8.  
  9. :: Note: the previous command is based on MODE CON's screen output
  10. :: for English Windows versions as shown in the following lines:
  11. ::
  12. :: Status for device CON:
  13. :: ----------------------
  14. ::     Lines:          25
  15. ::     Columns:        80
  16. ::     Keyboard rate:  31
  17. ::     Keyboard delay: 1
  18. ::     Code page:      437
  19. ::
  20. :: You may need to make FIND search for other strings
  21. :: than "s:" if you use a different language version.
  22.  
  23. :: Done
  24. GOTO End
  25.  
  26.  
  27. :Syntax
  28. ECHO.
  29. ECHO ScrSzNT.bat,  Version 1.00 for Windows NT 4 / 2000 / XP
  30. ECHO Save current window size -- lines and columns -- in
  31. ECHO environment variables "Lines" and "Columns".
  32. ECHO.
  33. ECHO Usage:  SCRSZNT
  34. ECHO.
  35. ECHO Notes:  Written for English Windows versions only; can be
  36. ECHO         adapted easily to other languages using this batch
  37. ECHO         file's embedded comments.
  38. ECHO.
  39. ECHO Written by Rob van der Woude
  40. ECHO http://www.robvanderwoude.com
  41.  
  42. :End
  43.  

page last modified: 2024-04-16; loaded in 0.0058 seconds