writing to registry in vista from guest account



Hi,

My application fails to write into registry key. When it runs in user/
guest account.

When I install my application in administrator, the installing process
creates reg key in HKLM.
I compile my application using manifest.
After the installation I create new user/guest account and runs the
application from that account.
The failure is when my application tries to write to the registry I
get the following error:
"Requested registry access is not allowed". I use the following code:
Note that I can read with no problem. My application doesn't fail in
administrator account.
try
{
// I get "Requested registry access is not allowed" error here...
RegistryPermission rm = new RegistryPermission
(RegistryPermissionAccess.AllAccess, TCPRoot);
rm.Demand();
}
catch (Exception e)
{
throw new Exception(e.Message);
}

RegistryKey myRegKey = Registry.LocalMachine;
myRegKey = myRegKey.OpenSubKey("SOFTWARE\\Giant Steps\\SLIP\\TCP",

RegistryKeyPermissionCheck.ReadWriteSubTree,

System.Security.AccessControl.RegistryRights.FullControl);
try
{
myRegKey.SetValue("Subnet", subnet);
}
catch (Exception e)
{
throw new Exception(e.Message);
}

Is there a way to write to a HKLM key which was created in admin
account from user/guest account?

Thanks.
.



Relevant Pages

  • Re: Service Pack 3 - Access Denied?
    ... resetting registry key permissions trashed my system every single time - it ... You may think you are the Administrator, but in reality you probably aren't. ... If your logged-in account identity is labeled "Computer Administrator" (under ... operating system files and the all branches of the "Windows Registry." ...
    (microsoft.public.windowsupdate)
  • Re: permissions maybe/bought computer, it is still registered in the sellers name
    ... Macromedia Shockwave 10 product on this computer also and am wondering if it is what is not letting XP SP 3 and Flash Player install. ... I am wondering what good it will do me to change the previous owners name in the registry. ... It seems there may be a legality involved here even though the previous owner is not the legal owner now, I mean, even if what I change his name to, it seems the new name should be registered properly for any effect. ... associated user account has been. ...
    (microsoft.public.windowsxp.newusers)
  • Re: computer account and application management strategy
    ... > you intend to run all programs as users but install applications as ... > administrator, you can run same install again after it is already ... > by administrator and it will make necessary registry changes for the user ... It may not work all the time with all the applications ...
    (microsoft.public.windowsxp.setup_deployment)
  • Re: computer account and application management strategy
    ... > you intend to run all programs as users but install applications as ... > administrator, you can run same install again after it is already ... > by administrator and it will make necessary registry changes for the user ... It may not work all the time with all the applications ...
    (microsoft.public.windows.server.setup)
  • Re: computer account and application management strategy
    ... > you intend to run all programs as users but install applications as ... > administrator, you can run same install again after it is already ... > by administrator and it will make necessary registry changes for the user ... It may not work all the time with all the applications ...
    (microsoft.public.win2000.setup)

Loading