Can't Merge Windows Registry

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 ]

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.

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.


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.