'========================================================================== ' ' NAME: enableLocalGPO.vbs ' ' COMMENT: This script enables the local GPO in pre-Vista systems ' '========================================================================== On Error Resume Next Const ForReading = 1 Const ForWriting = 2 Set WshShell = WScript.CreateObject("WScript.Shell") ' get the current system folder sysDir = WshShell.ExpandEnvironmentStrings("%WinDir%") Set objFSO = CreateObject("Scripting.FileSystemObject") If Err.Number <>0 Then WScript.Echo "Unable to create FileSystemObject" Err.Clear WScript.Quit(1) End If Set objFile = objFSO.OpenTextFile(sysDir+"\system32\grouppolicy\gpt.ini", ForReading) If Err.Number <>0 Then WScript.Echo "Unable to open gpt.ini for reading" Err.Clear WScript.Quit(1) End If Do Until objFile.AtEndOfStream strLine = objFile.ReadLine If InStr(strLine,"Options=") > 0 Then Else strContents = strContents & strLine & VbCrLf End If Loop objFile.Close Set objFile = objFSO.OpenTextFile(sysDir+"\system32\grouppolicy\gpt.ini", ForWriting) If Err.Number <>0 Then WScript.Echo "Unable to open gpt.ini for writing" Err.Clear WScript.Quit(1) End If objFile.Write(strContents) objFile.Close