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)