Is it possible to load PuTTY connection information (session) from file?

Solution 1:

You can create a .reg file with all the settings:

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\SOFTWARE\SimonTatham\PuTTY\Sessions\MySession]
"HostName"="example.com"
"Colour0"="187,187,187"
...

Import the settings using the reg command:

reg import MySession.reg 

And then load the imported settings using the -load switch of PuTTY:

putty.exe -load MySession

If you want, you can have the key deleted using the reg delete after starting PuTTY.

A complete batch file would be:

@echo off
reg import MySession.reg 
start putty.exe -load MySession
timeout /t 2
reg delete HKCU\SOFTWARE\SimonTatham\PuTTY\Sessions\mysession /f

(The two-second timeout is there to let the PuTTY load the settings before it gets deleted).


And of course there are loads of PuTTY clones that support configuration INI files. For example KiTTY.


Another option is to make use of WinSCP that can open PuTTY from a session specified on WinSCP command-line:

winscp.exe ssh://[email protected]/

While WinSCP allows much wider set of options on its command-line, it does not support terminal-specific options, like colors.

(I'm the author of WinSCP)

Solution 2:

Sorta, "putty user@host:port" or Putty -load “session name” or (3rd party tools) you might want to check out http://remotedesktopmanager.com/

more CLI stuff http://etherealmind.com/putty-command-line/

if you want password-less login generate a private key and use pageant.