Can't Merge Windows Registry

7

2

I was having issues with my computer (Windows 7 Pro 64 bit) and our support guys said it was related to my login going to a temporary profile. So, he created me a new profile. However, now I've lost my PuTTY and WinSCP configurations because they are stored in the registry. I figured out how to load a hive from my old profile and exported the WinSCP and PuTTY branches. However, I can't merge them to the registry; I get an "Error accessing the registry" message. I have administrator privileges and can access the registry via regedit. Why can't I merge the exports that came from the same machine?

Thanks!

EDIT

Here's a snippet of the putty.reg file that I exported from the registry after converting it to ASCII:

Windows Registry Editor Version 5.00

[HKEY_USERS\SimonTatham\Software\SimonTatham]

[HKEY_USERS\SimonTatham\Software\SimonTatham\PuTTY]

[HKEY_USERS\SimonTatham\Software\SimonTatham\PuTTY\Jumplist]
"Recent sessions"=hex(7):63,00,73,00,70,00,32,00,74,00,68,00,31,00,6e,00,6f,00,\
  20,00,28,00,70,00,72,00,6f,00,64,00,29,00,00,00,74,00,68,00,32,00,2e,00,6e,\
  00,6f,00,2e,00,63,00,67,00,2e,00,6e,00,6d,00,73,00,2e,00,6d,00,6c,00,62,00,\
  2e,00,69,00,6e,00,65,00,74,00,20,00,28,00,70,00,72,00,6f,00,64,00,29,00,00,\
  00,74,00,68,00,32,00,2e,00,6e,00,6f,00,2e,00,63,00,67,00,2e,00,6c,00,61,00,\
  62,00,2e,00,6e,00,6d,00,73,00,2e,00,6d,00,6c,00,62,00,2e,00,69,00,6e,00,65,\
  00,74,00,20,00,28,00,6c,00,61,00,62,00,29,00,00,00,73,00,63,00,6d,00,32,00,\
  2e,00,6e,00,6f,00,2e,00,63,00,67,00,2e,00,6e,00,6d,00,73,00,2e,00,6d,00,6c,\
  00,62,00,2e,00,69,00,6e,00,65,00,74,00,00,00,63,00,73,00,70,00,31,00,74,00,\
  68,00,31,00,7a,00,7a,00,20,00,28,00,6c,00,61,00,62,00,29,00,00,00,63,00,73,\
  00,70,00,32,00,74,00,68,00,31,00,73,00,6f,00,20,00,28,00,70,00,72,00,6f,00,\
  64,00,29,00,00,00,74,00,68,00,31,00,2e,00,6e,00,6f,00,2e,00,63,00,67,00,2e,\
  00,6e,00,6d,00,73,00,2e,00,6d,00,6c,00,62,00,2e,00,69,00,6e,00,65,00,74,00,\
  20,00,28,00,70,00,72,00,6f,00,64,00,29,00,00,00,74,00,68,00,31,00,2e,00,6e,\
  00,6f,00,2e,00,63,00,67,00,2e,00,6c,00,61,00,62,00,2e,00,6e,00,6d,00,73,00,\
  2e,00,6d,00,6c,00,62,00,2e,00,69,00,6e,00,65,00,74,00,00,00,77,00,62,00,33,\
  00,63,00,6f,00,2e,00,73,00,6f,00,63,00,2e,00,73,00,68,00,61,00,77,00,2e,00,\
  63,00,61,00,00,00,73,00,72,00,31,00,2e,00,6e,00,6f,00,2e,00,63,00,67,00,2e,\
  00,6f,00,73,00,73,00,2e,00,6d,00,6c,00,62,00,2e,00,69,00,6e,00,65,00,74,00,\
  00,00,74,00,68,00,31,00,30,00,2d,00,70,00,72,00,6f,00,64,00,00,00,61,00,70,\
  00,70,00,36,00,73,00,6f,00,63,00,6c,00,61,00,62,00,00,00,00,00

Since the file is over 3000 lines long, I'm not posting all of it. The unicode version of the file (before conversion) began with ÿþ and had a space between each character and each new line had an empty line between. For example:

ÿþW i n d o w s   R e g i s t r y   E d i t o r   V e r s i o n   5 . 0 0 


[ H K E Y _ U S E R S \ S i m o n T a t h a m \ S o f t w a r e \ S i m o n T a t h a m ]


[ H K E Y _ U S E R S \ S i m o n T a t h a m \ S o f t w a r e \ S i m o n   T a t h a m \ P u T T Y ]

sdoca

Posted 2012-04-27T18:58:59.473

Reputation: 606

Sounds like it is a permissions issue with the key you are trying to merge into. Registry keys have permissions just like folders in windows explorer. – Moab – 2012-04-28T03:30:24.870

Answers

6

The issue is different HKEY_USERS id's in your Windows installation and your registry file you wish to merge.

I had the exact same issue exporting my putty config to a new Windows 7 environment. Here's how I solved it:

  • Right click putty.reg file and chose the 'edit' option
  • Open regedit on the machine to merge putty config with
  • Copy the user ID# from the new machine under HKEY_USERS\\*your user ID# is here*
  • Replace the old ID# with the new ID# in the edit window for putty.reg
  • You should be able to merge the registry file without any issues.

user190439

Posted 2012-04-27T18:58:59.473

Reputation: 61

2Actually, you don't have to bother with the new ID#. All you need to do is use HKEY_CURRENT_USER\blahblah instead of HKEY_USERS\old-id\blahblah. – Mike Nakis – 2013-04-30T21:49:35.367

5

If you are trying to do this from a cmd prompt, then you must right click on the cmd icon in the start menu and choose "Run as administrator". You have to do this even if you are already an Administrator on the system.

Then you should be able to merge the registry entries.

jftuga

Posted 2012-04-27T18:58:59.473

Reputation: 2 877

I tried by right clicking the .reg files (located on my Desktop) and choosing the "Merge" option, got the warning about making changes to the registry and when it tries to merge, get the error message. There's no option to run as administrator from the right-click menu. – sdoca – 2012-04-27T19:49:44.650

1Don't do that. Do what he said and open a command prompt 'as administrator' and then merge your .reg files from there opening them. (I'm assuming opening and merging are the same.) OR, open a command prompt 'as administrator, then run regedit.exe, then open and merge your .reg files from that. Starting with Vista and continuing in Windows 7, having admin rights doesn't mean you're always running as administrator. – Mark Allen – 2012-04-27T20:14:46.400

2Ok, I tried merging via the command line (as administrator) and got the same error still. I also tried importing into regedit which I opened from the administrator command line and got the same error. :( – sdoca – 2012-04-27T21:41:50.643

3

I got this error when moving to Windows 10.

I did a combination of the above to fix mine.
When I exported it was keys from HKEY_Users\myname\Software... and it was in Unicode.

I did a global replace on the file, replacing HKEY_Users\myname with HKEY_CURRENT_USER\ That made the lines in the file look like this: [HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions]

I then had to save it as ANSI. I ran Regedit 'as administrator' and imported from the file/import menu.

Hope this helps someone.

Bill Curtis

Posted 2012-04-27T18:58:59.473

Reputation: 31

0

Just this week, on Windows 10 x64, I couldn't merge a ".reg" file into the registry simply because it was located on a network drive (ie: N:\ was pointing at \\localserver\someshare\, and reg file path was n:\whatever.reg). Moving the .reg file to a local hard drive fixed the issue for me. Your problem might be related.

Etienne Delavennat

Posted 2012-04-27T18:58:59.473

Reputation: 391

Your problem is not related. – DavidPostill – 2016-02-03T14:02:25.153

2Well, OP didn't specify WHERE he saved his ".reg" exports, so there's no proof that it's not related. Also, OP didn't come back and choose an answer either, so options are still open as to what the problem actually was. Also, anyone searching the net for this problem would hit this page, and my answer might apply to any passing visitor. So my answer is still a "possible answer". – Etienne Delavennat – 2016-02-03T15:06:03.093

0

1.Open CMD(Prompt MS-DOS) Run as Administrator, Paste, and Run(press ENTER):

reg add "HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\System" /t Reg_dword /v DisableRegistryTools /f /d 0

Marc

Posted 2012-04-27T18:58:59.473

Reputation: 1

0

I know this is old but for Putty specifically:

I followed the steps suggested by KronoS as the User ID was different in the exported reg key to that in my current registry.

However, still got the same error.

Noticed that there were a number of SSH keys listed at the bottom of the exported reg key under the SshHostKeys section. Removed these completely so it was just importing the sessions and I was able to successfully restore what I needed.

Hopefully this will prove helpful to others.

Mitas

Posted 2012-04-27T18:58:59.473

Reputation: 1

0

The file has to be saved as ASCII. For some reason, the file was saved as Unicode, and needs to be converted back.

And of course, like jftuga said, you need to merge as Administrator.

user3463

Posted 2012-04-27T18:58:59.473

Reputation:

I converted the file from unicode to ascii, and still no go. – sdoca – 2012-04-27T21:42:32.200

What do the contents of the file look like? Perhaps it is corrupt in some way. – None – 2012-04-27T21:44:04.320

I've updated my question with a snippet from the file. – sdoca – 2012-04-27T21:52:26.573

Is the User folder in the registry named the same way? Go into HKEY_USERS and have a look. If so, then I'm at a loss. Perhaps you need to log in as the Administrator and then merge the file. – None – 2012-04-27T22:34:18.330

If my profile name is "user", my old profile (at least the Users directory) was renamed "userbak". Should the exported hive/registry settings be "user" or "userbak" for them to be able to be imported? – sdoca – 2012-04-30T16:34:17.487

The new name, whatever that is, so "User". – None – 2012-05-01T21:23:44.497

0

I believe the exported data in the .reg files contains the Windows user ID # as part of the path of the reg key (like HKEY_USERS\S-1-5-21-602162358-1564985344-839422125-2292\etc).

I think the new profile you have has a different user ID # and therefore the exported path is invalid. You could 'find & replace' in the .reg export file which might work, but that may also trickle down other problems.

Dean

Posted 2012-04-27T18:58:59.473

Reputation: 1

0

Try Emergency Boot CD ( http://www.prime-expert.com/ebcd/ ). It contains offline registry editor, so you can export registry key from the old accout (HKEY_USERS\OldUsername) and import into the new account (HKEY_USERS\NewUsername).

EBCD is a shareware for $25. Export and import can be done in text (.REG) or binary format. Binary format is the same as native NT hive, so it preserves all metadata and permissions for the keys.

Mikhail Kupchik

Posted 2012-04-27T18:58:59.473

Reputation: 2 381

0

You can do it running the command prompt as administrator and then executing the export command as explained here:

regedit /e "%userprofile%\desktop\putty-sessions.reg" HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions

Source: https://stackoverflow.com/questions/13023920/how-to-export-putty-sessions-list

colonize

Posted 2012-04-27T18:58:59.473

Reputation: 1

-1

  1. Go to run -- regedit .
  2. In regedit go to --HKEy_CURRENTUSER >Software>SimonTATHAM. Right click to SIMONTATHAM, and select copy key name.

  3. Open reg file in word. On that file you will see [HKEY xxx/xxx/xxxx/xxxxxx ]. Replace everything in the close bracket with the key name you have copied in previous step. Do ctrl-H, fill in the items and replace all.

  4. Finally save it as .reg file and import it. Enjoy!!!!

Data85

Posted 2012-04-27T18:58:59.473

Reputation: 1