Click to See Complete Forum and Search --> : Renaming Registry Key - RegRestoreKey


drumz
January 21st, 2004, 09:01 AM
I am trying to rename a key in the Registry so that when the software is upgraded, all the configurations are saved, and the key name in the registry can be updated to reflect the new version. Any idea how this can be done?

In addition, I got the idea of copying the registry key and subkeys to the new key name then deleting the old one (similar to renaming). I used RegSaveKey to save to file, then RegRestoreKey to restore back from file. Save worked, but when trying to restore to registry from the file, I got:
ERROR code 19 The media is write protected - ERROR_WRITE_PROTECT. What is the problem?

Any idea how I can rename the key or copy the key and it's subkeys? Any help will be appreciated. Thanks.

indiocolifa
January 21st, 2004, 10:06 AM
first, check if a handle is previous opened.

2. try using REG_FORCE_RESTORE in RegRestoreKey.

hope it helps.

drumz
January 21st, 2004, 02:34 PM
Thank you...
I tried using REG_FORCE_RESTORE... but it still doesn't work!!
No handle is open either!