setting permission on a reg key

cornelvis

Active member
Joined
Jul 15, 2005
Messages
30
Programming Experience
3-5
hi all,

Here is what I want to do, but as I'm a vb rookie I don't know where to start.
I know how add and delete reg. keys and set a value, but not how to set the permissions on a subkey.

the scenario should be like this:
-open a form
-fill in textboxes with the Active Directory username
- click a button on a form.
- check if the name exists in Active Dir. If not prompt
- Find the subkey
- put in the username of the user
- set the permissions to full control

Maybe I can call the security window which normally pops up when selecting perissons in regedit?
Or can this be handled in the code?

Please let me know, as it would be very handy

thanks in advance

CornElvis
 
but that's just what I wanted to avoid.
All I want is to push that button after filling in the username
Maybe someone else knows?
 
Up to now I think the answer is no... you may refer to:
http://vbdotnetforums.com/showthread.php?t=4052

I've been thinking of a way to make this possible, but I've not implemented it yet. First, you need to launch regedit from your app. Second, you need to take over the mouse and keyboard access from the user. Click select (do what ever you need to do with the registry). Then close Regedit and return control to user.
 
so I can do this with Winbatch again.
The only thing I think about winbatch is that it's easy to use, but it's dirty and leaves dll files which you have to delete or store somewhere else.
Seems strange that there isn't a way to this with code within vb.net.
 
did you try this before?

I couldn't figure out what it sets, but it runs fine

VB.NET:
Dim[/color][/size][size=2] f [/size][size=2][color=#0000ff]As[/color][/size][size=2] [/size][size=2][color=#0000ff]New[/color][/size][size=2] RegistryPermission(RegistryPermissionAccess.Read [/size][size=2][color=#0000ff]Or[/color][/size][size=2] RegistryPermissionAccess.Write, "SOFTWARE\ODBC\ODBCINST.INI\\PeopleSoft\")

f.AddPathList(RegistryPermissionAccess.Write [/size][size=2][color=#0000ff]Or[/color][/size][size=2] RegistryPermissionAccess.Read, "SOFTWARE\ODBC\ODBCINST.INI\\PeopleSoft\")[color=#0000ff]


does this help?

let me know.

greetzzz,

Cornelis
 
Back
Top