Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Is there a way to read/write in to NT registry?

Is there a way to read/write in to NT registry?

Is there a way to read/write in to NT registry?

Here is the explanation of the problem.
I am writing a VB program to Query/update the Registry entries in both Windows and NT. The followin URL has the nice information about required functions information inside the advapi32.dll.
So this code is very well written and is working very well on windows95/98. But the problem is with the security aspects of NT. i.e. I was able to read an entry but it is giving an encripted number instead of real value of the
registry entry. Is there a way to read/write in to NT registry? I found the following code in side the above document interesting. This clearly tells that I need to do something different on NT to get around the
Security mask(SAM).' **********************************************
' Security mask attributes for Windows NT (SAM).
' **********************************************
nLength As Long lpSecurityDescriptor As Long bInheritHandle As Boolean
End Type
I am looking for suggestions/direction on how to proceed further on NT.
Also it is required that the computer to be on the network and not necessary
on a local domain.

RE: Is there a way to read/write in to NT registry?

You must have local machine administrator privileges. Depends on what kind of a guy your network mgr is.

RE: Is there a way to read/write in to NT registry?

Hi ScoobyDoo!

Like RoyLofquist said, you have to have administrator priveledges.

But.. it also depends on where in the registry you plan to write. If you want to write to the HKEY_CURRENT_USER, you shouldn't have a problem even if you don't have admin authority. Anywhere else, and you need to be in the administrators group, or be the administrator user.

Something else to pay attention to when you call RegOpenKeyEx(), is the access level you're requesting. You don't need KEY_ALL_ACCESS to do a simple read, and if you only want to write a value, then only request KEY_SET_VALUE, not KEY_WRITE access.

You can see all this in the MSDN docs.

Chip H.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close