Skip to content

Instantly share code, notes, and snippets.

@appleshan
Created October 10, 2017 09:33
Show Gist options
  • Select an option

  • Save appleshan/722590e0778d88bbcddb6bdb880ef90a to your computer and use it in GitHub Desktop.

Select an option

Save appleshan/722590e0778d88bbcddb6bdb880ef90a to your computer and use it in GitHub Desktop.
@echo off
setlocal ENABLEDELAYEDEXPANSION
set /a tee=0
for /f "tokens=1* delims==" %%a in (
'wmic DESKTOPMONITOR get ScreenWidth^,ScreenHeight^ /value'
) do (
set /a tee+=1
if "!tee!" == "3" set screenheight=%%b
if "!tee!" == "4" set screenwidth=%%b
)
set /a screenheight-=100
set /a screenwidth-=100
rem echo %screenheight%
rem echo %screenwidth%
mode con lines=%screenheight%
mode con cols=%screenwidth%
REM color 60
REM cls
@echo.
REM pause
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment