how to programming change group policy?

J

John

Hi, everyone, I'm writing an program which change the group policy, example,
I modify the registry

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
StartMenuLogOff(DWORD) = 1

and Use

SendMessage(HWND_BROADCAST, WM_SETTINGCHANGE, Integer(PChar('Polices')), 0);

to Refresh system , It take effect immedialtely! But when I open gpedit.msc,
It still display as "Not configration".
I search for registry, and found a location about this:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Group Policy
Objects\{B0449735-4902-4060-B54F-D08C50BBDE08}User\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer
StartMenuLogOff(DWORD) = 1

if you change the value under the key sync, gpedit.msc will accept our
modify! But the GUID will change every time when you run gpedit.msc and
diffrent for every PC! So i check the system direcotry, and I found the
file %system%wbem\Repository\FS\OBJECTS.DATA also store the policies! But I
don't know how to Update the WBEM(WMI) sync, Can anybody help me? Thank in
advance.

Best regards.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top