Solved

Save Registry File

Posted on 2000-03-05
13
191 Views
Last Modified: 2010-04-10
When trying to perform RegSaveKey()
the function returns error saying

"A required privilege is not held by the client."

How do I give right privilage to my process. Doing it from user manager didn't help.

Thanks
0
Comment
Question by:Yulia
  • 7
  • 5
13 Comments
 
LVL 9

Expert Comment

by:Pacman
Comment Utility
to which group do you want to write ?
(full path)
0
 

Author Comment

by:Yulia
Comment Utility
I want to backup some branch inside
HKEY_CURRENT_USER, I succeeded opening
it.
0
 

Author Comment

by:Yulia
Comment Utility
I want to backup some branch inside
HKEY_CURRENT_USER, I succeeded opening
it.
0
 
LVL 9

Expert Comment

by:Pacman
Comment Utility
how do you write the key?
Could you post the code please?
0
 

Author Comment

by:Yulia
Comment Utility


There is a key in my registry,
under HKEY_CURRENT_USER,
I put it in lpSubKey.

LONG error = RegOpenKeyEx(                          hKey,                           lpSubKey,                                 0,                                      KEY_ALL_ACCESS,                         &phkResult
       );
                        
LPCSTR f = "back.reg";
LONG error2 = RegSaveKey(      
            hKey, "back.reg", NULL);
0
 

Author Comment

by:Yulia
Comment Utility
The file back.reg is being created but
it's empty
0
Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

 
LVL 9

Expert Comment

by:Pacman
Comment Utility
how do you write the key?
Could you post the code please?
0
 
LVL 9

Expert Comment

by:Pacman
Comment Utility
oops, sorry i did hit reload ...
0
 
LVL 9

Expert Comment

by:Pacman
Comment Utility
Yulia,

in my SDK doc i read that you need a special privileg if you are on Windows NT. Are you using Windows NT ?
0
 

Author Comment

by:Yulia
Comment Utility
Yes, I know, what I don't know is
how to attach to a process this special privilage.
I use Windows NT
0
 
LVL 9

Expert Comment

by:Pacman
Comment Utility
Yulia,

there is a KB article about this. This should solve your problem.
Article ID: Q128731

If you dont have msdn I could post you the article if you want.
0
 
LVL 9

Accepted Solution

by:
Pacman earned 100 total points
Comment Utility
or view it on the online kb of the microsofties:

http://support.microsoft.com/support/kb/articles/Q128/7/31.asp?LNG=ENG&SA=ALLKB&FR=0

regards Pacman
0
 
LVL 2

Expert Comment

by:KAbbott
Comment Utility
This should help you there's plenty of help here:

http://www.codeguru.com/system/registry_ult.shtml

Try it !!!!!
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Errors will happen. It is a fact of life for the programmer. How and when errors are detected have a great impact on quality and cost of a product. It is better to detect errors at compile time, when possible and practical. Errors that make their wa…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now