3

I start multiple PuTTY sessions everyday with a specific path in each session.

I have made a command in batch file as

Start "c:\putty.exe" [email protected] -pw abc123 22

How do I proceed further to open PuTTY directly in a specific remote directory.

I have 20 sessions.

Please assist.

0

1 Answer 1

7

You need to create a file with two commands, the directory change and the shell start, like:

cd /path
/bin/bash

Then use the command-line parameter -m to "execute" the commands. You will also want to use the -t for force TTY back as the -m disables it.

putty.exe [email protected] -pw password -t -m commands.txt

To avoid a separate command file for each sessions, just generate it from the batch file:

set SCRIPT_FILE=%TEMP%\commands.txt
echo cd /path > %SCRIPT_FILE%
echo /bin/bash > %SCRIPT_FILE%
putty.exe [email protected] -pw password -t -m %SCRIPT_FILE%

References:


If you want GUI for managing sessions with specific initial remote path, you can use WinSCP.

(I'm the author of WinSCP)

0

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .