Save Registry File

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
YuliaAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
PacmanConnect With a Mentor Commented:
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
 
PacmanCommented:
to which group do you want to write ?
(full path)
0
 
YuliaAuthor Commented:
I want to backup some branch inside
HKEY_CURRENT_USER, I succeeded opening
it.
0
The new generation of project management tools

With monday.com’s project management tool, you can see what everyone on your team is working in a single glance. Its intuitive dashboards are customizable, so you can create systems that work for you.

 
YuliaAuthor Commented:
I want to backup some branch inside
HKEY_CURRENT_USER, I succeeded opening
it.
0
 
PacmanCommented:
how do you write the key?
Could you post the code please?
0
 
YuliaAuthor Commented:


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
 
YuliaAuthor Commented:
The file back.reg is being created but
it's empty
0
 
PacmanCommented:
how do you write the key?
Could you post the code please?
0
 
PacmanCommented:
oops, sorry i did hit reload ...
0
 
PacmanCommented:
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
 
YuliaAuthor Commented:
Yes, I know, what I don't know is
how to attach to a process this special privilage.
I use Windows NT
0
 
PacmanCommented:
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
 
KAbbottCommented:
This should help you there's plenty of help here:

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

Try it !!!!!
0
All Courses

From novice to tech pro — start learning today.