vPeeling - under the skin of virtualization

8Jan/090

Script: Set hardware acceleration using a script

If you have tried installing VMware Tools, you know that at the end it prompts you for changing hardware acceleration levels (which you always want to change anyways...). This is tedious process doing manually but can be automated.

Below is a VBscript that changes the hardware acceleration level to "Full" (save as .vbs and run). It works on Server 2003/2008 i assume that it works on XP/Vista/Win7 too...

I am using this script when installing VMs using MDT (the reason why it's a VBscript and not PowerShell) to automatically change hardware acceleration after VMware tools finishes installing.

If you want to check if all your current VMs have full hardware acceleration enabled, take a look at this awesome VI toolkit script from Hugo Peeters.

Note in the comments section of that post there is a description on how to change these settings directly in the .inf files for the drivers. Not tried that but sounds cool :)


Const HKEY_LOCAL_MACHINE = &H80000002
Const LookupValue = "Acceleration.Level"
Const FullAccel = "0"

strComputer = "."

Set objRegistry = GetObject("winmgmts:\\" & strComputer & "\root\default:StdRegProv")

strKeyPath = "HARDWARE\DEVICEMAP\VIDEO"
objRegistry.EnumValues HKEY_LOCAL_MACHINE, strKeyPath, arrValueNames, arrValueTypes

For Each strValue in arrValueNames
if instr(strValue, "Video") > 0 then
objRegistry.GetStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValue, strRunCommand

strPath = Replace(strRunCommand, "\Registry\Machine\", "")

objRegistry.SetDWORDValue HKEY_LOCAL_MACHINE, strPath, LookupValue, FullAccel
End If
Next

Comments (0) Trackbacks (0)

No comments yet.


Leave a comment

(required)

No trackbacks yet.