title: Why can't program write to HKEY_CURRENTUSER in Windows 7?
body: <p>The code below fails when running on Windows 7, with default access levels.  (This is a C# application, built with Visual Studio 2010).  I am writing to HKEY_CurrentUser, which is where I should be allowed to create and read keys.</p>
  
  <p>Do I need to modify my program's manifest? or is there another arcane trick?</p>
  
  <p>Under Windows 7, If you dial down the notify setting on your user account, the code works. But not with the factory setting.  Should programmers give up on the registry?</p>
  
  <pre><code>RegistryKey regsoftware = Registry.CurrentUser.OpenSubKey("Software", true);
  RegistryKey regsw = regsoftware.CreateSubKey("MyCompanyName");
  
  regsw.SetValue("User", Id);
  regsw.SetValue("Pwd", encodeString(Pw));
  </code></pre>
  
  <p>Thanks,
  Gerry</p>