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.
|