自动在1920×1080和1600×900分辨率间切换如果分辨率不等于以上2个中的一个那么切换到手动选择 分辨率根据自身电脑需要更改- @echo off & title 切换分辨率
- for /f "delims=" %%i in ('wmic DesktopMonitor get ScreenWidth^,ScreenHeight /value ^| findstr "="') do set "%%~i"
- if %ScreenWidth% equ 1920 (if %ScreenHeight% equ 1080 (SetRes h1600 v900) else (goto LargeResolution)
- ) else (goto LargeResolution)
- Exit
- :LargeResolution
- if %ScreenWidth% equ 1600 (if %ScreenHeight% equ 900 (SetRes h1920 v1080) else (goto SelectResolution
- )) else (goto SelectResolution)
- Exit
- :SelectResolution
- echo ----------------------------------
- echo 1、1920×1080 2、1600×900
- echo ----------------------------------
- choice /c 12 /N /M "敲入数字选择:"
- if %errorlevel%==1 SetRes h1920 v1080
- if %errorlevel%==2 SetRes h1600 v900
- mshta VBScript:MsgBox("完成!",vbSystemModal,"")(close) &CLS&GOTO SelectResolution
复制代码
|