Download to print the screen resolution to STDOUT.

When I type scrnres /? in a CMD.EXE window, it displays:

Version 1.0, Copyright (C)2001 Frank P. Westlake
Prints the resolution of the screen to STDOUT.

When I type scrnres, it displays:

1600 X 1200

To capture the screen resolution in an ScreenX and ScreenY environment variable, use the following commands in your batch script:

for /f "Tokens=1,3" %%x in ('scrnres') do (                               set /a ScreenX=%%x                               set /a ScreenY=%%y                              )