Set Hardware Acceleration Level

From Wiki

Revision as of 16:20, 17 February 2010 by Gurnles (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to:navigation, search

Here is a vbscript that will allow you to set the primary display's hardware acceleration automatically on Windows. To set the level edit the value uValue to the level required: 2000/XP: 0 being full acceleration and 5 being no acceleration Windows Server 2003: 5 being full acceleration and 0 being no acceleration

If you need to set it for other monitor outputs then change the sValue to be \Device\VideoX (X being the display number) To find this value browse in regedit to HKEY_LOCAL_MACHINE\HARDWARE\DEVICEMAP\VIDEO

NOTE: After running the script you may need to reboot for the changes to take effect.


<vb> Const HKEY_LOCAL_MACHINE = &H80000002

sComputer = "." sMethod = "GetStringValue" hTree = HKEY_LOCAL_MACHINE sKey = "HARDWARE\DEVICEMAP\VIDEO" sValue = "\Device\Video0"

Set oRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}//" & sComputer & "/root/default:StdRegProv")

Set oMethod = oRegistry.Methods_(sMethod) Set oInParam = oMethod.inParameters.SpawnInstance_()

oInParam.hDefKey = hTree oInParam.sSubKeyName = sKey oInParam.sValueName = sValue

Set oOutParam = oRegistry.ExecMethod_(sMethod, oInParam) strParse = oOutParam.Properties_("sValue")

sMethod = "SetDWordValue" hTree = HKEY_LOCAL_MACHINE sKey = Replace(strParse, "\Registry\Machine\", "",1,Len(sKey),1) 'replace command must run case insensitive to work on different hardware sValueName = "Acceleration.Level" '* In Windows XP Change the uValue value for Accelleration.Level from 0 (FULL) to 5 (none) uValue = 1

Set oRegistry = GetObject("winmgmts:{impersonationLevel=impersonate}//" & sComputer & "/root/default:StdRegProv") Set oMethod = oRegistry.Methods_(sMethod) Set oInParam = oMethod.inParameters.SpawnInstance_()

oInParam.hDefKey = hTree oInParam.sSubKeyName = sKey oInParam.sValueName = sValueName oInParam.uValue = uValue

Set oOutParam = oRegistry.ExecMethod_(sMethod, oInParam)

sComputer = Empty sMethod = Empty hTree = Empty sKey = Empty sValue = Empty sValueName = Empty uValue = Empty Set oRegistry = Nothing Set oMethod = Nothing Set oInParam = Nothing Set oOutParam = Nothing

WScript.Quit </vb>