registry problem

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.
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
W

Willy Denoyette [MVP]

| 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.
 
G

Guest

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.
 
W

Willy Denoyette [MVP]

| 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.
 
G

Guest

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
 
W

Willy Denoyette [MVP]

| 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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top