I have two Windows logins for the same computer at work, and I’ve been trying to make both of them as similar as possible. That means copying a lot of configuration files over from one login to another.
PuTTy is one tool I need for both logins, but alas, the session information is stored in the Windows Registry instead of a plain text file, something I learned from this informative article about transferring PuTTy settings between computers.
So what if I want to transfer session information between logins on the same computer?
One thing the article glosses over is the location in the Windows Registry where the information is stored. Rather than specifying to look under HKEY_USERS
, Grant Robertson, the author of the article, instructs you to perform a search instead. That’s wise because the tree structure under HKEY_USERS
will differ from computer to computer, or in my case, login to login.
Most of the situations where I’ve had to edit the Windows Registry involved making changes to HKEY_CURRENT_USER
or HKEY_LOCAL_MACHINE
, and they usually involved the SOFTWARE
key. For example:
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
HKEY_USERS
is similar with one exception — the first nested level is a unique identifier for a particular login:
HKEY_USERS\{unique key}\Software\SimonTatham\PuTTY\Sessions
So the trick when transferring sessions between users is to figure out which unique key to use. What I ended up doing is using the search function to find the various instances where the PuTTY\Sessions
key was repeated. One of them would have my sessions. (Let’s identify it as S-1-5-21-1234567890-123456789-1234567890-123456
.) The other would not. (We’ll call that one S-1-5-21-0987654321-987654321-0987654321-654321
.)
When I found the key that contained my PuTTy sessions, I exported it. Then I edited that export in Notepad and changed any reference to the unique identifier of my original login to the unique identifier of my new login.
HKEY_USERS\S-1-5-21-1234567890-123456789-1234567890-123456\Software\SimonTatham\PuTTY\Sessions
becomes
HKEY_USERS\S-1-5-21-0987654321-987654321-0987654321-654321\Software\SimonTatham\PuTTY\Sessions
I then imported the edited export file back into the Windows Registry.
When I launched PuTTY, the sessions were listed under my new login.