CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 8 of 8
  1. #1
    Join Date
    Jul 1999
    Posts
    2

    Rename registry key


    How can I rename an NT registry key using the Win32 APIs without doing a tree copy of all the keys and values below it.
    I want to be able to rename a whole branch, as a backup, before writing the new contents of the branch.




  2. #2
    Join Date
    Jun 1999
    Posts
    315

    Re: Rename registry key

    i am not aware of this functionality.

    miked

  3. #3
    Join Date
    May 1999
    Posts
    3,332

    Re: Rename registry key

    try the RegReplaceKey, RegSaveKey APIs


  4. #4
    Join Date
    Jun 1999
    Posts
    319

    Re: Rename registry key

    Where did you find this functions? Is there any documentation for them? I try to find them in the MSDN, but I can't find nothing.
    Thanks for your time.
    Regards,
    Faby


  5. #5
    Join Date
    May 1999
    Posts
    3,332

    Re: Rename registry key

    of course MSDN!
    these are pretty old suckers.
    RegReplaceKey requires NT 3.5...


  6. #6
    Join Date
    May 1999
    Posts
    3,332

    Re: Rename registry key

    and...
    do a DUMPBIN /exports of advapi32.dll.
    They really exist :-)


  7. #7
    Join Date
    Jun 1999
    Posts
    319

    Re: Rename registry key

    Thanks, I made the dump, I saw that it exists. I also find the .h file...but in the MSDN I still can't find them. I think they forgot to include them.
    Regards,
    Faby


  8. #8
    Join Date
    Jul 1999
    Posts
    2

    Re: Rename registry key

    The RegReplaceKey and RegSaveKey APIs backup and restore registry subtrees from files which may be what I have to do. What I would like to do is open a key using RegOpenKeyEx and rename the key that was opened.

    e.g. Open the key \\HKEY_LOCAL_MACHINE\Software\Company\ProgData and call an API to rename the opened key to ....\ProgData_OLD.

    The NT regedit program allows this, right click on a registry key and select rename. Internally it may copy the whole subtree to a new tree with the new name then delete the old subtree. I am beginning to think this is the way it must work.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured