Scripting Question

Tools for scripting changes to local group policy?

07/26/2004 14977 views
I have been looking for a way to script changing individual settings in the local group policy under Windows XP Pro. I found a tool called snapreg.exe in the Windows Media Player Enterprise Deployment Pack available at http://www.microsoft.com/windows/windowsmedia/enterprise/deploypack.aspx.

snapreg.exe correctly updates the registry.pol and gpt.ini files under %SystemRoot%\System32\GroupPolicy and the local group policy. It has however one shortcoming: it does not seem to be able to delete a setting from the local group policy files, only change its value once set.

Are there any other tools or perhaps a COM object available for scripting that can be used to add, change and delete entries in the local group policy?

By the way, here is the documentation for snapreg.exe:

Documentation for snapreg

Snapreg.exe is a utility for changing local Group Policy settings and
adding registry keys.

Note: It does not simply change the policy settings in the registry
but also updates or creates the Group Policy files in

Snapreg.exe is included in the Windows Media Player Enterprise
Deployment Kit which can be downloaded from:


Despite its lack of documentation it is extremely useful for changing
local Group Policy settings.


snapreg.exe ( /GetInfo | /SetInfo)

/GetInfo: reads registry and policy information listed in
regkey.ini from local machine and writes values to
regkey.txt and policy.txt respectively.

If regkey.txt is missing from the current
directory no action will be taken by snapreg.

/SetInfo: reads policy.txt and regkey.txt from current
directory and applies the values to local group
policy and local registry respecitvely.

Note: command line options are case sensitive.

regkey.ini is used by the /SetInfo mode of snapreg to generate
regkey.txt and policy.txt.

The format of regkey.ini is:

-------- snip --------------------

-------- snip --------------------

regkey.txt lists registry values which snapreg should set when called
with /SetInfo.

The format of regkey.txt is:

-------- snip --------------------
HKLM,Software\Myprogram\Keypath,ValueName,,"string value"
-------- snip --------------------

The first value above is a REG_DWORD value, indicated by
the 0x00010001 tag. The value is given in decimal notation.

The second value is a REG_SZ value.

Policy.txt uses the same format for describing entries as regkey.txt
but only applies to local Group Policy.

-------- snip --------------------
HKCU,Software\Policies\Company\Program,PolicySetting,,"string value"
HKCU,Software\Microsoft\Windows\CurrentVersion\policies,PolicySetting,,"string value"
-------- snip --------------------
0 Comments   [ + ] Show comments


Be the first to answer this question

Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.

Don't be a Stranger!

Sign up today to participate, stay informed, earn points and establish a reputation for yourself!

Sign up! or login


This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ