Can anyone tell me what is wrong with this script? I have used this exact script with other WMIC commands and it works fine. The WMIC commands also work fine outside of the script.
FOR /F "tokens=*" %%A in ('wmic DESKTOPMONITOR get ScreenHeight') do SET MyScreenHeight=%%A FOR /F "tokens=*" %%B in ('wmic DESKTOPMONITOR get ScreenWidth') do SET MyScreenWidth=%%B REM Removes spaces including trailing spaces from variables set MyScreenHeight=%MyScreenHeight: =% set MyScreenWidth=%MyScreenWidth: =% echo. echo Your resolution is %MyScreenWidth% x %MyScreenHeight% pause
Chad L. Hutson
Owner, CPU Vet
www.cpuvet.com