ch4rl1e97

resize.bat

Sep 12th, 2016
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Batch 1.03 KB | None | 0 0
  1. @SET %ERRORLEVEL%=0
  2. REM Error checks
  3. @IF /I "%~1"=="eggs" (iexplore.exe "https://upload.wikimedia.org/wikipedia/commons/5/54/Bg-easter-eggs.jpg")
  4. @IF "%~1"=="" (ECHO ERROR: No Input^! Try "Resize help"&&PAUSE&&EXIT /b 1)
  5. @IF /I "%~1"=="help" goto help
  6. @IF "%~1"=="?" goto help
  7. @SET /a errorcheck=%~1 >nul 2>&1
  8. @IF NOT %ERRORLEVEL% EQU 0 (ECHO Resize only accepts integer number input^! Try "Resize Help"&&PAUSE&&EXIT /b 1)
  9. @IF "%~2"=="" (goto justcol)
  10. @SET /a errorcheck=%~2 >nul 2>&1
  11. @IF NOT %ERRORLEVEL% EQU 0 (ECHO Resize only accepts integer number input^! Try "Resize Help"&&PAUSE&&EXIT /b 1)
  12.  
  13. @MODE con: cols=%1 lines=%2
  14. @EXIT /b 0
  15.  
  16. :justcol
  17. REM Set cols
  18. @MODE con: cols=%1
  19. @EXIT /b 0
  20.  
  21. :help
  22. ECHO Resize the current CMD window
  23. ECHO.
  24. ECHO Usage:
  25. ECHO Resize [Collumns]
  26. ECHO Change just the width of the screen.
  27. ECHO.
  28. ECHO Resize [Collumns] [Lines]
  29. ECHO Change both width and height. (Buffer will also be set by setting Lines)
  30. ECHO.
  31. ECHO Arguments must be integers.
  32. ECHO.
  33. ECHO Default values are 80 cols, 25 lines.
Advertisement
Add Comment
Please, Sign In to add comment