Post Installation to Change Screen Resolution on the K2000

Description

These scripts get the screen resolution from a Windows computer before reinstalling the OS and set it back to the original resolution after the operating system has been installed. You can also use these scripts to manually or automatically define/redefine the screen resolution.  

Download the Tasks
*Note: you must be a member of the K2000 ITNinja Community to download this file.


The script contains three parts:

  • Get Rez Pre Installation Task that uses get_screen_rez.exe to capture the resolution settings. Runs before creating a partition or formatting a drive.
  • Copy Rez Post Installation Task with KBE runtime (mid-level) that uses copy_rez.exe to get the captured resolution settings and put them on the local harddrive for use after the first boot into windows by the next post installation task.
  • Change Rez Post Installation Task with Windows runtime that uses rez_change.exe to deploy the resolution setting captured by get_screen_rez.

How to use this script

The scripts work together by capturing, copying, and applying the screen resolution information using a text file that is accessible during the various stages of deployment. This text file is saved by default to the drive T: (which in KBE is mapped to the K2000 hidden share PETemp), copied from that location to the local harddrive, and used to change the resolution after the first boot into Windows. When deploying from a USB, \\K2000\PETemp is not mapped to T: because USB deployments run locally and without a network connection. When deploying from USB use the drive switch, for example, get_screen_rez.exe /drive:X:, copy_rez.exe  /drive:X:, and rez_change.exe to save and get the information alternate location, where X: is Winpe environment loaded into memory.

There is no error checking by these scripts, the command line must be exact.

Saving the screen resolution during a deployment

After downloading and extracting the Screen Resolution zip, set up the corresponding tasks on your K2000 Appliance as follows:

Capturing the resolution

To set up the task to capture the screen resolution:

  1. Click Library > Preinstallation Tasks.
  2. In Choose Action, click Add New Application.
  3. Enter the name of the task "Get Screen Resolution x86" or "Get Screen Resolution x64".
  4. Click Browse and select the get_screen_rez.exe (for x86) or get_screen_rez_x64.exe from extracted zip.
  5. Enter the name of the executable in the command line text box, for example get_screen_rez.exe.
  6. Click Save.

Copying the saved resolution back to the local drive

To set up the task to copy the screen resolution:

  1. Click Library > Postinstallation Tasks.
  2. In Choose Action, click Add New Application.
  3. Enter the name of the task "Copy Screen Resolution x86" or "Copy Screen Resolution x64".
  4. Select the Runtime Environment of K2000 Boot Environment.
  5. Click Browse and select the copy_rez.exe (for x86) or copyrez_x64.exe from extracted zip.
  6. Enter the name of the executable in the command line text box, for example copy_rez.exe.
  7. Click Save.

Apply the saved resolution

To set up the task to apply the screen resolution:

  1. Click Library > Postinstallation Tasks.
  2. In Choose Action, click Add New Application.
  3. Enter the name of the task "Change Screen Resolution x86" or "Change Screen Resolution x64".
  4. Select the Runtime Environment of Windows.
  5. Click Browse and select the change_rez.exe (for x86) or change _x64.exe from extracted zip.
  6. Enter the name of the executable in the command line text box, for example change_rez.exe.
  7. Click Save.

Setting a new screen resolution during a deployment

Using only the Resolution Changer script you can set the resolution as a Postinstallation Task in Windows. The script has two additional options that allow you to either set the resolution to what you specify from the command line or prompt you to manually enter the resolution. When using either one of these switches the file containing the resolution if it exists is ignored.

Predefining the screen resolution

Use the following switches to set the resolution:

  • /x:dddd sets the horizontal dimension of the screen
  • /y:vvv sets the vertical dimension of the screen

To set up the task to predefine the screen resolution:

  1. Click Library > Postinstallation Tasks.
  2. In Choose Action, click Add New Application.
  3. Enter the name of the task "Set Screen Resolution x86" or "Set Screen Resolution x64".
  4. Select the Runtime Environment of Windows.
  5. Click Browse and select the change_rez.exe (for x86) or change _x64.exe from extracted zip.
  6. Enter the name of the executable with the set options in the command line text box, for example change_rez.exe /x:1024 /y:768.
  7. Click Save.

Prompt to manually set the screen resolution

Use the following switch to be prompted for the screen resolution during the postinstallation process:

  • /manual displays a window and waits for input

To set up the task to predefine the screen resolution:

  1. Click Library > Postinstallation Tasks.
  2. In Choose Action, click Add New Application.
  3. Enter the name of the task "Set Screen Resolution x86" or "Set Screen Resolution x64".
  4. Select the Runtime Environment of Windows.
  5. Click Browse and select the change_rez.exe (for x86) or change _x64.exe from extracted zip.
  6. Enter the change_rez.exe /manual or changerezx64.exe /manual command line text box .
  7. Click Save.

ScreenRez

by: Corey A. Serrins
Version History
===============
v.2.1.2.1 [05/20/2012]
-update HRC to version 2.1
-fixed issue I didn't notice when updating to 1.9 with a "first run" dialog.
-added /hidetrayicon /exit, which are HRC commandlines to remove extra code.
-had to change the run command to runwait since the exit is now automatic.
-will use the last 2 digits in version number to indicate version of HRC.

v.2.0.0.1 [04/03/2012]
-updated HRC to version 1.9 in rez change.
-modified get_screen_rez, as it wasn't pulling default resolution for Windows XP

v.2.0.0.0 [02/25/2012]
-now using HRC as the utility to change the resolution instead of the usual include to see if result are better
-HRC is from < a href="http://funk.eu/hrc/">http://funk.eu/hrc/
-script modifies HRC.ini in %temp%\rez_change to include the selected resolution as the first modifier
-script calls HRC.exe R1 shortcut to change the resolution.
-implemented a systray refresh so that the HRC ghost icon would disappear when the app was exited.

v 1.2.0.0 1/30/2011
-fixed /manual on change rez, where it would take the parameters but exit the script before changing resolution.
-added get_screen_rez and copy_rez in case user wants to copy the resolution from a previous working machine.


v.1.1 12/29/2011
-added get_screen_rez.exe


v.1 8/19/2011
-initial release with commandline options and dialog box.


**Known Issues**
None