how to add a bulk load of putty sessions

add bunch of putty sessions.  This requires cygwin base install which includes the sed command.  Be sure to add \cygwin\bin to the path:
create a "template" putty session with all the settings you want.  go into the registry and export the session: HKEY_CURRENT_USER\Software\SimonTatham\PuTTY\Sessions\session_name

put a list of machine names in test.txt

then in dos:

for /f %a in (test.txt) do type m.reg | sed -e 's/Template_NAME/%a/g'>> all.reg

These sessions can then be used in putty session manager or any of the other putty related tools.

1 comment:

Janak said...

Thanks! Found this post very useful and saved me hours.

Had to search on how to convert reg files into sessions, found this good article:


Also, a small optimization maybe that there are some ports of "sed" utility on windows, so one may avoid installing cygwin. (though cygwin is recommended if you do hack around things :).