registry problem

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello
I have a registry key but Only "SYSTEM" account is having
permission to access it.!! . How can I change /addd
permission to Administrator too. I know its possible by
right clicking the concerned reg key and give full contro
to Admin by a couple of clicks. How to do it
programatically (C#)

Thanks in advance.
 
sgr,

Programatically, if you are using .NET 1.1 and earlier, you will have to
use the API through the P/Invoke layer to do this.

If you are using .NET 2.0, you can call the SetAccessControl method on
the RegistryKey class to set the permissions.

Hope this helps.
 
| Hello
| I have a registry key but Only "SYSTEM" account is having
| permission to access it.!! . How can I change /addd
| permission to Administrator too. I know its possible by
| right clicking the concerned reg key and give full contro
| to Admin by a couple of clicks. How to do it
| programatically (C#)
|
| Thanks in advance.
|

No, this is something you can't do programatically, only Regedit (running as
administrator) is allowed to add ACE's to the list when even when
Administrator(s) have been removed.
Why was administrator(s) removed in the first place.

Willy.
 
Thanks Nicholas

I tried with this:
f = New RegistryPermission(RegistryPermissionAccess.Write, rTree)

But it doesn´t work.



Nicholas Paldino said:
sgr,

Programatically, if you are using .NET 1.1 and earlier, you will have to
use the API through the P/Invoke layer to do this.

If you are using .NET 2.0, you can call the SetAccessControl method on
the RegistryKey class to set the permissions.

Hope this helps.


--
- Nicholas Paldino [.NET/C# MVP]
- (e-mail address removed)

sgr said:
Hello
I have a registry key but Only "SYSTEM" account is having
permission to access it.!! . How can I change /addd
permission to Administrator too. I know its possible by
right clicking the concerned reg key and give full contro
to Admin by a couple of clicks. How to do it
programatically (C#)

Thanks in advance.
 
| Thanks Nicholas
|
| I tried with this:
| f = New RegistryPermission(RegistryPermissionAccess.Write, rTree)
|
| But it doesn´t work.
|

No, and it can't work, read my other post in the thread.
This would extremely compromise security if this would be possible, don't
you think so?
My question remains, why did you remove 'administrators' from the list of
ACE's.

Willy.
 
Sorry,
My English is very bad, when i wrote Administrator I didn´t refer to Admin
account I wanted to say that I'm local administrator of the machine.

Thanks for all
 
| Sorry,
| My English is very bad, when i wrote Administrator I didn´t refer to
Admin
| account I wanted to say that I'm local administrator of the machine.
|

Your key has only an lowed ACE for the SYSTEM account, that means that
no-one else can access the key, Believe me only regedit can do it. But you
still did not answer the question - why did you remove 'administrators' from
the list?


Willy.
 
Back
Top