Instead of having to create a new custom command and passing login information and
-cmd on command line (of which unable to pass SSH keyfile and if user doesnt want to use pageant), here is a solution to re-use already existing "Open in PuTTY (Ctrl+J)" command which already passes information through registry. Following method will add "Autocommand" registry value as well to the other registry values that WinSCP already writes in "WinSCP Temporary Session".
- Download kitty.exe (non-portable) into your WinSCP directory.
- Create a file named
kitty.iniwith the following contents in your WinSCP directory. Modifyinitdelaydepending on your connection speed. I found 6 seconds to be a good Autocommand delay to work across a variety of servers.[KiTTY]
initdelay=6.0 - Create an Autohotkey script named
WinSCPLaunchKittyTempsession.ahkwith the following contents that you then compile intoWinSCPLaunchKittyTempsession.exein your WinSCP directory. Pre-compiled script attached.RegWrite, REG_SZ, HKEY_CURRENT_USER, Software\9bis.com\KiTTY\Sessions\WinSCP`%20temporary`%20session, Autocommand, cd "%1%"
Run, kitty.exe -load "WinSCP Temporary Session"
- In WinSCP, View > Preferences > Integration > Applications > PuTTY/Terminal Client Path:
WinSCPLaunchKittyTempsession.exe "!/" - In WinSCP, View > Preferences > Integration > Applications > PuTTY Registry Key
Software\9bis.com\KiTTY
- Now you can fast-open in current directory just with WinSCP > "Open in PuTTY" (in the commands menu, or
Ctrl+P). No need to create a custom command. And it works with SSH keyfiles and all as well.