Topic "Putty command line options"

Author Message
Y-Phil
[View user's profile]

Joined: 2011-10-26
Posts: 4
Hi

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.
Y-Phil.
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 24530
Location: Prague, Czechia
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.

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

Where portforward.bat is like:

Code:
@echo off
if "%1" == "example.com" echo -L80:localhost:80 -L5432:localhost:5432


See
http://winscp.net/eng/docs/ui_pref_integration_app
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License