i requre a scrip through which i can directly make changes to the keys in gpedit ??

Thanks in advance.

Dani AI

Generated

Quick clarification for : gpedit.msc is just an MMC console; there is nothing inside the .msc file you can "edit" with a script. What you can automate is the underlying stores that Local Group Policy writes to. ’s macro idea will not affect policy itself.

On Windows 2000/XP there are two practical paths:

  • Security Settings (password policy, audit policy, user rights, services, file/registry ACLs): use secedit to import a security template (.inf).
  • Administrative Templates (registry-based policies): set the mapped registry values under HKLM/HKCU Policies keys. This changes the effective setting, but the next policy refresh will overwrite it unless the local GPO has the same value, so consider applying it at startup/logon or also managing the local GPO via code.

Example: apply security policy from an INF file:

; C:\policy.inf
[Version]
signature="$CHICAGO$"

[System Access]
PasswordComplexity = 1
MinimumPasswordLength = 8
secedit /configure /db "%TEMP%\secpol.sdb" /cfg "C:\policy.inf" /quiet
gpupdate /force

See the secedit reference for syntax and areas you can configure: Secedit command.

Example: set a registry-based policy (disable Control Panel for the current user):

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer" ^
  /v NoControlPanel /t REG_DWORD /d 1 /f
gpupdate /target:user /force

More on the reg tool: Reg command.

Notes:

  • Domain GPOs will override local changes at refresh.
  • Direct registry edits affect the setting immediately but are not durable against policy refresh unless the local GPO is configured the same way.
  • If you need to truly author the Local GPO (so gpedit shows the setting), you would use the Group Policy Object COM APIs from native code; there is no built-in VBScript interface on XP.

Recommended Answers

All 2 Replies

Hi

try writing a macro and edit it from the program you want to use to open it.


HTH
Darren
South Africa

I m not getting you exactly. I want to make changes in GPedit.msc. I want to write windows script for making changes in gpedit.msc. so that i need not to do manual changes. Is it possible in any manner ??

Pratik Mavani

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.