Changing Directory dont work

Advertisement

elch
Guest

Changing Directory dont work

Hello,

i have this command line:
C:\Programme\WinSCP\WinSCP.exe /console /command "option batch on" "option confirm off" "open User@123.123.123.123:21" /privatekey="I:\projects\putty-key_ssh-2_rsa.ppk" "cd /OUT/"

Everything works fine, but the command for directory changing ("cd /OUT/") does not work (i tried many combinations: with/without quotes etc...). If I shell the command line it logs onto the server and just ignores the cd /OUT/. If I type cd /OUT/ manually, it works fine.

It seems, that every command after the privatekey-command gets ignored (for example: exit).

Can somebody please help to fix my syntax problem? Version is up to date: 4.2.9

Thank you very much!

Reply with quote

Advertisement

elch
Guest

Solution found

Hello,

after trying several hours I found out, that I have to place the privatekey command before the open command.

C:\Programme\WinSCP\WinSCP.exe /console /privatekey="C:\putty-key_ssh-2_rsa.ppk" /command "option batch on" "option confirm off" "open User@123.123.123.123:21" "cd /OUT/"

:D :D :D

Reply with quote

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

Re: Solution found

Actually you should do:
C:\Programme\WinSCP\WinSCP.exe /console "option batch on" "option confirm off" "open -privatekey=""C:\putty-key_ssh-2_rsa.ppk"" User@123.123.123.123:21" "cd /OUT/"

But your solution will work as well.

Reply with quote

elch
Guest

Re: Solution found

Hello prikryl,

thank you for your reply AND thank you very much for programming WinSCP !!!

It helps a lot!

Reply with quote

Advertisement

You can post new topics in this forum