Re: writing to registry in vista from guest account
- From: "Mr. Arnold" <Arnold@xxxxxxxxxx>
- Date: Tue, 27 Jan 2009 13:33:46 -0500
alexia wrote:
On Jan 27, 6:28 pm, "Cowboy \(Gregory A. Beamer\)"
<NoSpamMgbwo...@xxxxxxxxxxxxxxxxxx> wrote:
The option I know is to reduce security on this particular hive so a user
can alter it. I am not sure this is wise. Better to put the configuration in
a config file, even if you have to encrypt it.
Another option is releasing the app as a web site or a click once
deployment, where it does not require registry access.
--
Gregory A. Beamer
MVP; MCP: +I, Se, SD, DBA
Blog:http://feeds.feedburner.com/GregoryBeamer
*************************************************
| Think outside the box! |
*************************************************"alexia" <alexia....@xxxxxxxxx> wrote in message
news:e5b4c34b-2a9b-4b97-9baa-8c9cf3b2bb4b@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,- Show quoted text -
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.- Hide quoted text -
Hi Cowboy,
So what you are saying is that CE application can't modify registry
settings in HKLM
even if it has been elevated?
That's correct. The Standard user can have its rights elevated to admin level by giving a admin user-id a psw, which is only at the moment of escalation and is not maintained for the user.
By escalating rights of a user that is a Standard user does not make the user have admin rights at the moment of privileged escalation. If the user account is a non-admin account, then it's not going to have admin rights as an designated user admin account, and the access is denied.
Even an admin user account, the one out of the box or subsequent new user admin accounts created, are not user-admin accounts with UAC enabled. They are Standard users accounts as user admin on Vista, which has two access tokens assigned to the user-admin account.
One token is for Standard user and the other one is for full admin rights token. The admin user with UAC enabled must have its rights escalated to use the full admin rights token to perform the admin tasks, and then the user admin is returned to being a Standard user.
Can I write the settings in CURRENT_USER? Will each user has his own
entry which will be set to his account?
You need to find out how UAC is working from a programmer's view point and how Virtualization works on Vista with UAC.
http://technet.microsoft.com/en-us/magazine/2007.06.uac.aspx
<http://www.symantec.com/community/article/2665/folder-virtualization-concepts-windows-vista>
I think you're going to have to use this account to give you the power, which is not that user-admin account out of the box.
<http://www.howtogeek.com/howto/windows-vista/enable-the-hidden-administrator-account-on-windows-vista/>
I do recall something about how to get settings set by user-account, but it had to with Virtualization and you'll have to follow that path and look it up using Google, becuase you're not going to be able to do too much with Vista and user admin concerning the registry, becuase Vista is not XP or any other previous versions of the NT based O/S.
You can't even get away with certain things on Vista, even if you use the hidden account, that has full admin rights at all times, as Vista will protect itself from even a user using that account with UAC enabled or disabled.
.
- Follow-Ups:
- Re: writing to registry in vista from guest account
- From: alexia
- Re: writing to registry in vista from guest account
- References:
- writing to registry in vista from guest account
- From: alexia
- Re: writing to registry in vista from guest account
- From: Cowboy \(Gregory A. Beamer\)
- Re: writing to registry in vista from guest account
- From: alexia
- writing to registry in vista from guest account
- Prev by Date: Re: Convert this string to a datetime
- Next by Date: Re: Casting integers to generic parameters
- Previous by thread: Re: writing to registry in vista from guest account
- Next by thread: Re: writing to registry in vista from guest account
- Index(es):
Relevant Pages
|