@ECHO OFF :: GetRes.bat, Version 4.00 for Windows XP :: Get display resolution settings :: Written by Rob van der Woude :: http://www.robvanderwoude.com :: Search the registry tree for the required values SET Key=HKCC\System\CurrentControlSet\Control\VIDEO FOR /F "skip=5 tokens=*" %%A IN ('REG QUERY "%Key%"') DO ( FOR /F "skip=5 tokens=*" %%B IN ('REG QUERY "%%~A"') DO ( FOR %%C IN (BitsPerPel XResolution YResolution VRefresh) DO ( FOR /F "skip=4 tokens=*" %%D IN ('REG QUERY "%%~B" /v DefaultSettings.%%C') DO ( CALL :Display %%D ) ) ECHO. ) ) SET Key= SET Val= SET __Video. GOTO:EOF :Display :: Convert hexadecimal values to decimal SET /A Val = %3 :: Display the result AND store the "last" values in variables FOR /F "tokens=2 delims=." %%a IN ('ECHO.%1') DO ( ECHO.%%a %Val% SET __Video.%%a=%Val% ) GOTO:EOF