-2

I am trying to create a user log off script by adding a registry entry under HKCU\Software\Microsoft\Windows\CyrrentVersion\GroupPolicy\Scripts\Logoff.

After I install the msi I built, the registry keys are set properly. Once the installation ends, the system is rebooting and I see that the keys are deleted.

What could be going wrong ?

Daniel A. White
  • 187,200
  • 47
  • 362
  • 445
user1528803
  • 67
  • 3
  • 8

1 Answers1

1

That key is owned by group policy. Anything you change there will be changed back by group policy on the next refresh. You shouldn't store anything in the Group Policies manually or via your program to the registry. If you add the key VIA group policy, it will stay.

Delorean
  • 491
  • 4
  • 17
  • How do I add a registry key via group policy ? Which the key I need to use ? – user1528803 Sep 11 '12 at 13:27
  • The machine needs to be on a domain, like a corporate network, and you need permissions to the domain controllers and/or active directory for your domain. It's more complex than that but that's the jist of it. – Delorean Sep 14 '12 at 22:23