Post a reply

Add an Attachment

If you do not want to add an Attachment to your Post, please leave the Fields blank.

(maximum 10 MB; please compress large files; only common media, archive, text and programming file formats are allowed)


Topic review


Re: Putty command line options

You can make a script/batch file that takes a host name as an argument and produces specific switch on its output. Then use !`command` pattern in PuTTY path to make use of that script. Use !@ pattern to pass a host name to the script. Use of !@ unfortunately comes at cost that WinSCP does not create temp site in PuTTY anymore. So you will need to explicitly pass a username using !U pattern and you cannot pass other specific parameters.

%PROGRAMFILES%\PuTTY\putty.exe !`C:\path\portforward.bat !@` !U@!@

Where portforward.bat is like:

@echo off

if "%1" == "" echo -L80:localhost:80 -L5432:localhost:5432


Putty command line options


Once again: thank you for that awesome program.

Here is a situation I am confronted to almost every day. I use WinSCP (even trough a double-tunnel) to do some remote editing. Then comes the time to test. Ctrl-P launches an instance of Putty. Everything works fine...
Almost. Something that would help me would be the ability to add a string that serves as additional command-line options used when launching Putty, string stored in each WinSCP session. These string could for example keep some settings such as "-L80:localhost:80 -L5432:localhost:5432" and thus be used by putty when it starts.
I have tried to store only a few settings in Putty but it looks like it's actually unable to load a partial profile form the registry.

Thus, this would come in rather handy.

Thanks in advance.