Transferring PuTTY session data

3

1

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?

toolkit

Posted 2010-02-16T15:17:39.503

Reputation: 229

Answers

4

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.

heavyd

Posted 2010-02-16T15:17:39.503

Reputation: 54 755

1And just FYI, you will need to Unload the hive in order to get it out of the registry after loading it. Just click on the loaded hive then select File -> Unload Hive. That one took me a second to figure out as the error message when you try to delete the loaded hive root key is not very useful. – heavyd – 2010-02-16T15:52:31.600

Aha - and an extra point for the Unload Hive tip :-) – toolkit – 2010-02-16T15:57:49.187

1

Export only putty data from regedit:

regedit /e "%userprofile%\desktop\putty.reg" HKEY_CURRENT_USER\Software\SimonTatham

On your target PC right click on the putty.reg file and merge.


To transfer it to PuTTY portable

PuTTY portable configs are stored in PuTTYPortable\Data\settings\. Simply moving exported putty.reg to PuTTYPortable\Data\settings\ do not work. PuTTY Portable backup the file and create a new empty one.

To workaround this issue, merge both putty.reg copying manually the config you want to migrate from your exported putty.reg to the newly created PuTTYPortable\Data\settings\putty.reg below following lines.

REGEDIT4

[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY]
"RandSeedFile"="D:\\Programme\\PuTTYPortable\\Data\\settings\\PUTTY.RND"

L. G.

Posted 2010-02-16T15:17:39.503

Reputation: 131

0

This can quickly and easily be accomplished through command line.

Bring up the command prompt window by clicking the Start Menu in the task bar or pressing the Windows key, then type cmd and press enter.

Navigate to the directory you desire to save the file to. For example, to save it to the current user's Desktop, type cd Desktop and press enter.

Now export the PuTTY registry information by entering the following:

REG EXPORT HKCU\Software\SimonTatham\PuTTY PuTTY.reg

To import the data, use cmd again and navigate with cd to the location of the PuTTY.reg file and enter:

REG IMPORT PuTTY.reg

Note that these entries are all case sensitive.

Paul

Posted 2010-02-16T15:17:39.503

Reputation: 698