I recently needed to be able to automatically set the display resolution during operating system deployment. I couldn’t get the resolution to change by setting the XResolution and YResolution MDT properties so I put together the following solution.
After following a thread on a myITforum mailing list about the same issue I put together this solution using this Video Resolution Changer which worked best for me out of the bunch that were mentioned. You could swap it out for another EXE by modifying the script.
The display resolution is configured automatically during deployment by running ResSwitch.vbs as a step in the task sequence. I started with this Speed/Duplex script and modified it to set the resolution instead, using ResSwitch.ini to hold the configuration.
ResSwitch.ini uses the following format:
[HWP2694]
;HP L2045w
WIDTH=1680
HEIGHT=1050
Where the string between the brackets must be found in the “PNPDeviceID” WMI value in the root\cimv2\Win32_DesktopMonitor class. Lines beginning with “;” are ignored. You must include WIDTH and HEIGHT entries to specify the desired display resolution. All displays will be set to 32-bit colour depth and 60Hz refresh rate.
To retrieve the PNPDeviceID value in order to add a new monitor to ResSwitch.ini you can run the following:
1. Open a Command Prompt
2. Run “wmic desktopmonitor list full”
3. Look for the PNPDeviceID value and select a subset to use as the search string. Typically the value between the backslashes will work best.
To use the script just unzip the ResSwitch.zip file below, download the Video Resolution Changer and copy 1365VidChng.exe to the same folder. Then run ResSwitch.vbs, i.e., “cscript ResSwitch.vbs”.
It would be cool to collect a whole bunch of PNPDeviceIDs with resolutions to build a comprehensive INI file. Feel free to post yours in the comments and I’ll add it to the file!













Pingback: Automatically Setting Display Resolution | System Center Ideas - Rod Trent at myITforum.com
#1 by world free on January 13th, 2010
Quote
works great when running manually but doesn’t seem to change anything as part of a task sequence. logs show that it ran fine…just no resolution change. any advice on the task sequence?
here’s a couple of entries as well
[LGD0000]
;Dell E6400 with Privacy Filter
WIDTH=1280
HEIGHT=800
[LEN4022]
;Lenovo T60p
WIDTH=1400
HEIGHT=1050
#2 by Chad Ingles on January 13th, 2010
Quote
If it works interactively then it should work via task sequence. You could add a pause at the end of the script, or wrap the script in a batch file with a pause to see if it is actually executing. I would check the command-lines and startup/working directories depending on whether you added it as an Application or are running it directly using “Run Command Line” in the TS.
If you add a pause during the TS execution you can also double-check the WMI lookup results and compare it to the string you’re trying to match.
Let me know how it goes!
#3 by zmobile on February 2nd, 2010
Quote
I cannot seem to get this to work with windows 7 64bit. It does work with Windows XP. The Windows 7 does not error out and shows the contents of the .ini file, but it does not call the video changer app
#4 by Jay on February 18th, 2010
Quote
Where at in the TS do you put this?
#5 by Chad Ingles on February 18th, 2010
Quote
Somewhere after the target OS is installed, typically around the Install Applications step in the Standard Client Task Sequence.