Paras Sidhu
Paras Sidhu

Reputation: 670

Easy way to take ownership of a Registry key in VB.NET?

I am creating a VB.NET application and I want that application to be able to take ownership of few Registry keys.

There doesn't seem to be an easy way to do this. Someone suggested to me a complex procedure that requires about 300 lines of code. It seems to me that is too much effort for what is conceptually an easy task.

So, is there a straightforward way to change or take ownership of a Registry key?

Upvotes: 1

Views: 499

Answers (1)

Richard
Richard

Reputation: 109100

Assuming the current user has the necessary rights to take ownership:

(I suspect the 300 lines of code was using P/Invoke from the days before the .NET framework had support for reading and manipulating ACLs.)

Upvotes: 2

Related Questions