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".
1. Download kitty.exe (non-portable) into your WinSCP directory.
2. Create a file named kitty.ini with the following contents in your WinSCP directory. Modify initdelay depending 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
3. Create an Autohotkey script named WinSCPLaunchKittyTempsession.ahk with the following contents that you then compile into WinSCPLaunchKittyTempsession.exe in your WinSCP directory. Pre-compiled script attached.
4a. In WinSCP, View>Preferences>Integration>Applications>Putty/Terminal Client Path:
4b. In WinSCP, View>Preferences>Integration>Applications>Putty Registry Key
5. 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.
1. Download kitty.exe (non-portable) into your WinSCP directory.
2. Create a file named kitty.ini with the following contents in your WinSCP directory. Modify initdelay depending 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
3. Create an Autohotkey script named WinSCPLaunchKittyTempsession.ahk with the following contents that you then compile into WinSCPLaunchKittyTempsession.exe in 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"
4a. In WinSCP, View>Preferences>Integration>Applications>Putty/Terminal Client Path:
WinSCPLaunchKittyTempsession.exe "!/"
4b. In WinSCP, View>Preferences>Integration>Applications>Putty Registry Key
Software\9bis.com\KiTTY
5. 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.