Transferring PuTTY session data

putty

My Windows NT account name was changed, and when starting PuTTY it now appears that my saved session information has been lost.

The FAQ suggests that PuTTY sessions should be stored in HKEY_CURRENT_USER\Software\SimonTatham\PuTTY.

Wikipedia explains that HKCU maps to NTUSER.DAT and USRCLASS.DAT under the current user's Desktop and Settings folder.

I still have these files for my old account name, but I'm guessing there is no easy way to extract data from these files?

Best Answer

As described by this Microsoft TechNet article you can load a .dat file into an existing registry:

To load a hive into the registry

  1. Open Registry Editor.
  2. In the registry tree (on the left), click either the HKEY_USERS or HKEY_LOCAL_MACHINE keys.
  3. On the File menu, click Load Hive.
  4. In Look in, click the drive, folder, or network computer and folder that contains the hive you want to load.
  5. Click Open.
  6. In Key Name, type the name that you want to assign to the hive, and then click OK.

You can then browse the tree and export the PuTTY configuration from

HKCU or HKLM\Entered Key Name\Software\SimonTatham\PuTTY

For the bit where you want to add the old registry settings into your new registry. Before using 'File > Import' to import your .reg file, do the following (I did this on my Windows XP machine and it worked)

  • Open your saved .reg file in an editor
  • Replace all occurences of 'HKCU or HKLM\Entered Key Name' with 'HKEY_CURRENT_USER' so that the reg paths look like the following:

    Windows Registry Editor Version 5.00
    [HKEY_CURRENT_USER\Software\SimonTatham]
    [HKEY_CURRENT_USER\Software\SimonTatham\PuTTY]
    

    etc.

Related Question