Network Administrator Knowledgebase

Jul 22 2008   9:34PM GMT

Script for Changing the Screen Resolution in Windows Server 2008 Server Core

Michael Khanin Michael Khanin Profile: Michael Khanin

I just finished with a script video_res.bat :). This scripts helps change the screen resolution in Windows Server 2008 Server Core. You can do this manually, but simple use Regedit, but you should know exactly what video driver is working right now in your system, my script does it for you, you just need to select the resolution and that it! Here is a content of video_res.bat:

@ECHO OFF
Rem ****************************************************************
Rem *                                                              *
Rem * Script to change display resolution in Windows 2008 Core     *
Rem *                                                              *
Rem * http://thesystemadministrator.com -  http://www.admininfo.ca *
Rem *                                                              *
Rem ****************************************************************

FOR /F “TOKENS=2 delims={}” %%a in (‘”REG QUERY HKLM\SYSTEM\CurrentControlSet\Control\Video /s /f VolatileSettings”‘) do set VIDEOCARD=%%a

@echo Please select display resolution:

@echo 1 – 640×480
@echo 2 – 800×600
@echo 3 – 1024×768
@echo 4 – 1280×720
@echo 5 – 1280×800
@echo 6 – 1280×1024
@echo 7 – 1440×900
@echo 8 – 1600×1200

SET /P VRES=To set display resolution to 1024×768 type 1 :

IF /i %VRES%==1 REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Video\{%VIDEOCARD%}000 /v DefaultSettings.XResolution /t REG_DWORD /d 640 /f&REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Video\{%VIDEOCARD%}000 /v DefaultSettings.YResolution /t REG_DWORD /d 480 /f&goto :EOF
IF /i %VRES%==2 REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Video\{%VIDEOCARD%}000 /v DefaultSettings.XResolution /t REG_DWORD /d 800 /f&REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Video\{%VIDEOCARD%}000 /v DefaultSettings.YResolution /t REG_DWORD /d 600 /f&goto :EOF
IF /i %VRES%==3 REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Video\{%VIDEOCARD%}000 /v DefaultSettings.XResolution /t REG_DWORD /d 1024 /f&REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Video\{%VIDEOCARD%}000 /v DefaultSettings.YResolution /t REG_DWORD /d 768 /f&goto :EOF
IF /i %VRES%==4 REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Video\{%VIDEOCARD%}000 /v DefaultSettings.XResolution /t REG_DWORD /d 1280 /f&REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Video\{%VIDEOCARD%}000 /v DefaultSettings.YResolution /t REG_DWORD /d 720 /f&goto :EOF
IF /i %VRES%==5 REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Video\{%VIDEOCARD%}000 /v DefaultSettings.XResolution /t REG_DWORD /d 1280 /f&REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Video\{%VIDEOCARD%}000 /v DefaultSettings.YResolution /t REG_DWORD /d 800 /f&goto :EOF
IF /i %VRES%==6 REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Video\{%VIDEOCARD%}000 /v DefaultSettings.XResolution /t REG_DWORD /d 1280 /f&REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Video\{%VIDEOCARD%}000 /v DefaultSettings.YResolution /t REG_DWORD /d 1024 /f&goto :EOF
IF /i %VRES%==7 REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Video\{%VIDEOCARD%}000 /v DefaultSettings.XResolution /t REG_DWORD /d 1440 /f&REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Video\{%VIDEOCARD%}000 /v DefaultSettings.YResolution /t REG_DWORD /d 900 /f&goto :EOF
IF /i %VRES%==8 REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Video\{%VIDEOCARD%}000 /v DefaultSettings.XResolution /t REG_DWORD /d 1600 /f&REG ADD HKLM\SYSTEM\CurrentControlSet\Control\Video\{%VIDEOCARD%}000 /v DefaultSettings.YResolution /t REG_DWORD /d 1200 /f&goto :EOF

Remember to Log Off and Log On again ;).

2  Comments on this Post

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when other members comment.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • GarryW999
    Hi, I just ran the script and got 'The syntax of the command is incorrect'. Just wanted to check, is the following line correct: "SET /P VRES=To set display resolution to 1024×768 type 1 :" Thanks, Garry
    0 pointsBadges:
    report
  • GarryW999
    All sorted - I had copied the script into Word temporarily which automatically replaced all single and double quotes with 'smart quotes' which were then not recognised :).
    0 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to: