Putty relative path not working. Must load from WinSCP starting directory.

Advertisement

user564758
Joined:
Posts:
23

Putty relative path not working. Must load from WinSCP starting directory.

I have experienced a slight issue with how WinSCP loads putty.

I have WinSCP loaded via bat file.

loadme.bat
calls
start bin\WinSCP.exe

It seems that the putty integration does not recognize a relative path when putty is in a different directory to the starting command. So unless it is in the same directory as the bat file it cannot work without setting a full path.

If i cd into the folder first using the bat file, then call do start
WinSCP.exe
it works as intended.

So this bat file only works if putty is in the same location as the bat file.

start bin\WinSCP.exe & for %%f in (%cd%\keys\*.ppk) do start bin\kageant.exe "%%f"
exit

Whereas this bat file only works if putty in the same directory as WinSCP.

cd %cd%\bin
start WinSCP.exe & for %%f in (%cd%\..\keys\*.ppk) do start kageant.exe "%%f"
exit

Is this a bug or something intentional i don't fully understand? I'd like to be able to set a relative path to putty regardless of where WinSCP was started.

Reply with quote

Advertisement

martin
Site Admin
martin avatar
Joined:
Posts:
41,518
Location:
Prague, Czechia

Re: Putty relative path not working. Must load from WinSCP starting directory.

I'm not sure I understand.

What do you mean by "load putty"? Are you referring to "Open session in PuTTY" command?

By default WinSCP is configured to run %ProgramFiles%\PuTTY\putty.exe, so the working directory should not matter.

Reply with quote

Advertisement

You can post new topics in this forum