Code Script .co.uk

Home | Scripts | Tutorials | Disclaimer | Sitemap | Contact

   Change Display Resolution
 

Vbscript / Operating System / Change Display Resolution

Change the display resolution using the registry. Settings are applied only after reboot.


Const HKEY_CURRENT_CONFIG = &H80000005

strComputer = "."
strEntryNameX = "DefaultSettings.XResolution"
strEntryNameY = "DefaultSettings.YResolution"
strEntryNameY = "DefaultSettings.FixedOutput"

strDefaultAdapter = "{1F6BE902-B94F-4E0A-88D7-06814F059B90}"

intFix = 0

Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\" & _
    strComputer & "\root\default:StdRegProv")

strKeyPath = "System\CurrentControlSet\Control\VIDEO"
objReg.EnumKey HKEY_CURRENT_CONFIG, strKeyPath, arrSubKeys

For Each Subkey in arrSubKeys

If SubKey <> strDefaultAdapter Then

strVKeyPath = strKeyPath & "\" & SubKey & "PageCont00"

objReg.SetDWORDValue HKEY_CURRENT_CONFIG, strVKeyPath, strEntryNameX, intX
objReg.SetDWORDValue HKEY_CURRENT_CONFIG, strVKeyPath, strEntryNameY, intY

objReg.SetDWORDValue HKEY_CURRENT_CONFIG, strVKeyPath, strEntryNameFix, intFix





Please note that a disclaimer applies to any code on this page.
 
   Actions
  Go Back
  Bookmark
  Print Page


   Menu
 
- Links
- Reference
- Script Editors
- Tutorials
- Vbscript
     - Active Directory
     - Exchange
     - Files And Folders
     - General
     - Ms Office
     - Operating System
          - Add Remove Windows Server 2003 Components
          - Add Remove Windows Vista Components
          - Add Remove Windows Xp Components
          - Autologon And Runonce
          - Change Display Resolution
          - Change Location I386 Setup Files
          - Change Offline Folder Cache Location
          - Dell Bios Set Boot Device Order
          - Dell Bios Set Configuration Settings
          - Dell Bios View Configuration Settings
          - Dell Bios View Device Boot Order
          - Disable Vista User Account Control
          - Enumerate Cd Drives
          - Enumerate Computer Drives
          - Enumerate Disk Volumes
          - Enumerate Registry Keys
          - Flush Remote Dns Cache
          - Get Machine Hardware Model
          - Read Registry Key
          - Rename Computer
          - Rename Dell Machine By Service Tag
          - Set Internet Explorer Homepage
          - Set Random Desktop Wallpaper On Startup
          - Start And Stop A Service
          - Windows Login Timer
     - Processes And Services
     - Text Processing
     - User Interaction
     - Web Servers