Skip to content
View in the app

A better way to browse. Learn more.

MSFN

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Tools for scripting changes to local group policy?

Featured Replies

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 Kit available at http://www.microsoft.com/windows/windowsme...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

%SystemRoot%\System32\GroupPolicy.

Download

--------

Snapreg.exe is included in the Windows Media Player Enterprise

Deployment Kit which can be downloaded from:

http://www.microsoft.com/windows/windowsmedia/download/

Despite its lack of documentation it is extremely useful for changing

local Group Policy settings.

Usage:

------

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

==========

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

regkey.txt and policy.txt.

The format of regkey.ini is:

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

[Keys]

HKCU,Software\Myprogram\Keypath,ValueName

HKLM,Software\Myprogram\Keypath,ValueName

[Policies]

HKLM,Software\Policies\Company\Program,PolicySetting

HKCU,Software\Policies\Company\Program,PolicySetting

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

regkey.txt

==========

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

with /SetInfo.

The format of regkey.txt is:

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

HKCU,Software\Myprogram\Keypath,ValueName,0x00010001,0

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

==========

Policy.txt uses the same format for describing entries as regkey.txt

but only applies to local Group Policy.

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

[Policies]

HKLM,Software\Policies\Company\Program,PolicySetting,0x00010001,0

HKCU,Software\Policies\Company\Program,PolicySetting,,"string value"

HKLM,Software\Microsoft\Windows\CurrentVersion\policies,PolicySetting,0x00010001,1

HKCU,Software\Microsoft\Windows\CurrentVersion\policies,PolicySetting,,"string value"

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


Create an account or sign in to comment

Recently Browsing 0

  • No registered users viewing this page.

Account

Navigation

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.