Checks to see if the Local GPO hidden directory (%windir%\system32\grouppolicy) and the GPT.ini file have been created on the local computer. Script contributed by Microsoft's Mike Stephens and Judith Herman.
'This script checks to see if a GPT.INI file has been created in the LGPO hidden directory: '%windir%\system32\GROUPPOLICY 'If this file exists we know the LGPO has been created. 'First find the windows directory which can be different on each machine set wshshell = CreateObject("WScript.Shell") windir = wshshell.ExpandEnvironmentStrings("%WINDIR%") 'Using the path relative to the windows directory look for the GPT.INI file set objFSO = CreateObject("Scripting.FileSystemObject") filename = windir & "\SYSTEM32\GROUPPOLICY\GPT.INI" If objFSO.FileExists(filename) Then Wscript.Echo "Local GPO Exists" Else Wscript.Echo "Local GPO does not exist" End If
'This script checks to see if a GPT.INI file has been created in the LGPO hidden directory: '%windir%\system32\GROUPPOLICY 'If this file exists we know the LGPO has been created. 'First find the windows directory which can be different on each machine set wshshell = CreateObject("WScript.Shell") windir = wshshell.ExpandEnvironmentStrings("%WINDIR%") 'Using the path relative to the windows directory look for the GPT.INI file set objFSO = CreateObject("Scripting.FileSystemObject") filename = windir & "\SYSTEM32\GROUPPOLICY\GPT.INI" If objFSO.FileExists(filename) Then Wscript.Echo "Local GPO Exists" Else Wscript.Echo "Local GPO does not exist" End If