联盟域名:www.cn-dos.net 论坛域名:www.cn-dos.net/forum DOS,代表着自由开放与发展,我们努力起来,学习FreeDOS和Linux的自由开放与GNU精神,共同创造和发展美好的自由与GNU GPL世界吧!
@echo off for /f "skip=6 tokens=3" %%i in ('reg query HKCC\SYSTEM /s ^|findstr Resolution') do echo %%i pause
@echo off setlocal EnableDelayedExpansion for /f "tokens=3" %%i in ('reg query HKCC\SYSTEM /s ^|findstr Resolution') do ( set /a Num+=1 if !Num! LEQ 2 ( set /a str=%%i echo !str! ) ) pause
Set WshShell = WScript.CreateObject("WScript.Shell") XResolution = WshShell.RegRead("HKEY_CURRENT_CONFIG\System\CurrentControlSet\Control\VIDEO\{D7F18ECC-5E3A-474C-9877-3BF7E5FE1A25}\0000\DefaultSettings.XResolution") YResolution = WshShell.RegRead("HKEY_CURRENT_CONFIG\System\CurrentControlSet\Control\VIDEO\{D7F18ECC-5E3A-474C-9877-3BF7E5FE1A25}\0000\DefaultSettings.YResolution") msgbox XResolution & "&" & YResolution
Originally posted by ccwan at 2007-7-9 07:52: re zh159 我每次更改分辨率后,使用代码测试,发现前4行都不是当前分辨率,所以才有2楼的代码。
Originally posted by slore at 2007-7-9 11:18: {D7F18ECC-5E3A-474C-9877-3BF7E5FE1A25}对不同的电脑可能不一样
@echo off echo 当前分辨率为: for /f %%i in ('"wmic desktopmonitor get screenwidth,screenheight /value"') do set %%i>nul echo %screenwidth% %screenheight% pause>nul