Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @SET %ERRORLEVEL%=0
- REM Error checks
- @IF /I "%~1"=="eggs" (iexplore.exe "https://upload.wikimedia.org/wikipedia/commons/5/54/Bg-easter-eggs.jpg")
- @IF "%~1"=="" (ECHO ERROR: No Input^! Try "Resize help"&&PAUSE&&EXIT /b 1)
- @IF /I "%~1"=="help" goto help
- @IF "%~1"=="?" goto help
- @SET /a errorcheck=%~1 >nul 2>&1
- @IF NOT %ERRORLEVEL% EQU 0 (ECHO Resize only accepts integer number input^! Try "Resize Help"&&PAUSE&&EXIT /b 1)
- @IF "%~2"=="" (goto justcol)
- @SET /a errorcheck=%~2 >nul 2>&1
- @IF NOT %ERRORLEVEL% EQU 0 (ECHO Resize only accepts integer number input^! Try "Resize Help"&&PAUSE&&EXIT /b 1)
- @MODE con: cols=%1 lines=%2
- @EXIT /b 0
- :justcol
- REM Set cols
- @MODE con: cols=%1
- @EXIT /b 0
- :help
- ECHO Resize the current CMD window
- ECHO.
- ECHO Usage:
- ECHO Resize [Collumns]
- ECHO Change just the width of the screen.
- ECHO.
- ECHO Resize [Collumns] [Lines]
- ECHO Change both width and height. (Buffer will also be set by setting Lines)
- ECHO.
- ECHO Arguments must be integers.
- ECHO.
- ECHO Default values are 80 cols, 25 lines.
Advertisement
Add Comment
Please, Sign In to add comment