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”

image

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!

ResSwitch.zip

Share and Enjoy:
  • Print
  • Digg
  • del.icio.us
  • Facebook
  • Google Bookmarks
  • email
  • LinkedIn
  • Live
  • Twitter