' ' Author: jamie.morrison@au1.ibm.com ' ' Purpose: Set the video acceleration to full ' and perform operations on the workstation. Typically used for non-domain members. ' ' Revision: 20/06/2008 v1.0 Initial release ' ' Option Explicit On Error Resume Next If setVideoAcceleration Then wscript.echo "Updated Video Acceleration" Else wscript.echo "Nothing to set" End If Function setVideoAcceleration() ' ' SYNTAX: setVideoAcceleration() ' ' Parameters: N/A ' ' Returns: True if registry written successfully ' ' Example: setVideoAcceleration ' ' Remarks: ' Const HKEY_LOCAL_MACHINE = &H80000002 Const VIDEO_LIST = "SYSTEM\CurrentControlSet\Control\Video" Dim wbemLocator, wbemDefault, wshShell, regStdWMI, adapterList, adapterGUID, adapterPath, dwValue Set wbemLocator = CreateObject("WbemScripting.SWbemLocator") Set wbemDefault = wbemLocator.ConnectServer(".", "root\default") Set wshShell = WScript.CreateObject("WScript.Shell") setVideoAcceleration = False Set regStdWMI = wbemDefault.Get("StdRegProv") If (Err.Number <> 0) Then script.echo "Error connecting to WMI StdRegProv " & Err.Number & " : " & Err.Description Else regStdWMI.EnumKey HKEY_LOCAL_MACHINE, VIDEO_LIST, adapterList If (Err.Number <> 0) Then wscript.echo "Could not enumerate video adapters" Else For Each adapterGUID In adapterList adapterPath = VIDEO_LIST & "\" & adapterGUID & "\0000" regStdWMI.GetDWORDValue HKEY_LOCAL_MACHINE, adapterPath, "Acceleration.Level", dwValue If Not IsNull(dwValue) Then regStdWMI.SetDWORDValue HKEY_LOCAL_MACHINE, adapterPath, "Acceleration.Level", 0 setVideoAcceleration = True End If Next End If End If Set regStdWMI = Nothing Set wshShell = Nothing Set wbemDefault = Nothing Set wbemLocator = Nothing End Function