Set Hardware Acceleration Level

Ik vond een mooi script op het Edugeek. Het zet automatisch Hardware Acceleration Level op full.

Const HKEY_LOCAL_MACHINE = &H80000002
sComputer = "."
sMethod = "GetStringValue"
hTree = HKEY_LOCAL_MACHINE
sKey = "HARDWAREDEVICEMAPVIDEO"
sValue = "DeviceVideo0"
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, "RegistryMachine", "")
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

Sla het bovengenoemde script op als een vbs.
Je kunt dit ideaal gebruiken tijdens het deployen van virtuele machines via MDT in combinatie met automatische uitrol van VMware Tools. Nu hoef je zelf niet meer de Hardware Acceleration level aan te passen. Ik heb het getest onder XP & Windows 2003.

Leave a Reply

Translate »