Windows – ny way to load a saved PuTTY session from a specific directory

puttywindows

At work, management wants to use a program called "Deep Freeze" on everyone's computers, which will restore the computer back to an "original state" after a restart, meaning that if I create a document on my desktop after it starts, it will be erased upon restart.

We can let the IT department know what programs we need to have installed, and for PuTTY, I'd like to have my session saved upon every restart.

Is it possible to have PuTTY load a saved session from a specific directory?

Note: This is for a machine that runs Windows 7.

Best Answer

No, the standard PuTTY cannot load the settings from a file.

Some PuTTY clones, such as KiTTY, can.
See https://www.9bis.net/kitty/#!pages/Portability.md


See also Storing configuration in a file section in PuTTY documentation:

PuTTY does not currently support storing its configuration in a file instead of the Registry. However, you can work around this with a couple of batch files.

You will need a file called (say) PUTTY.BAT which imports the contents of a file into the Registry, then runs PuTTY, exports the contents of the Registry back into the file, and deletes the Registry entries. This can all be done using the Regedit command line options, so it's all automatic. Here is what you need in PUTTY.BAT:

@ECHO OFF
regedit /s putty.reg
regedit /s puttyrnd.reg
start /w putty.exe
regedit /ea new.reg HKEY_CURRENT_USER\Software\SimonTatham\PuTTY
copy new.reg putty.reg
del new.reg
regedit /s puttydel.reg

This batch file needs two auxiliary files: PUTTYRND.REG which sets up an initial safe location for the PUTTY.RND random seed file, and PUTTYDEL.REG which destroys everything in the Registry once it's been successfully saved back to the file.

Here is PUTTYDEL.REG:

REGEDIT4

[-HKEY_CURRENT_USER\Software\SimonTatham\PuTTY]

Here is an example PUTTYRND.REG file:

REGEDIT4

[HKEY_CURRENT_USER\Software\SimonTatham\PuTTY]
"RandSeedFile"="a:\\putty.rnd"

You should replace a:\putty.rnd with the location where you want to store your random number data. If the aim is to carry around PuTTY and its settings on one USB stick, you probably want to store it on the USB stick.