writing to registry in vista from guest account
- From: alexia <alexia.bee@xxxxxxxxx>
- Date: Tue, 27 Jan 2009 05:03:26 -0800 (PST)
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.
.
- Follow-Ups:
- Re: writing to registry in vista from guest account
- From: Cowboy \(Gregory A. Beamer\)
- Re: writing to registry in vista from guest account
- Prev by Date: MAKE OVER $2000 P/M FROM ONLINE FREE MONEY MAKING NETWORK
- Next by Date: Build configuration
- Previous by thread: MAKE OVER $2000 P/M FROM ONLINE FREE MONEY MAKING NETWORK
- Next by thread: Re: writing to registry in vista from guest account
- Index(es):
Relevant Pages
|
Loading