Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Setting WinSCP with explicit TLS encryption

Tags:

ftp

winscp

ftps

I am trying to connect to a FTP server with following setting

winscp UI setting

This setting works well and I can connect to FTP server via GUI (version 5.7.5)

However, when I try to convert these settings to script

winscp.com /command "option batch abort" "option confirm off" "open ftp://username:[email protected]:21 -   
explicittls /" "put -filemask=>1D  D:\Backups\*.bak /" "exit"

and run it from cmd, there is an error message indicated that there is

Too many parameters for command 'open'."

What did I do wrong here and how to resolve it ?

like image 828
wraith Avatar asked Feb 09 '23 19:02

wraith


1 Answers

It's

winscp.com /command "open ftp://username:[email protected]/ -explicit" ...

or simply

winscp.com /command "open ftpes://username:[email protected]/" 

See:

  • https://winscp.net/eng/docs/scriptcommand_open
  • https://winscp.net/eng/docs/session_url

You get the "Too many parameters for command 'open'" because of the / after the explicittls. Or because of the explicittls itself, if you really have the spaces there in-between the - and the explicittls.


You can use Generate Transfer Code Dialog to have WinSCP generate the script or batch file for you.

Generate transfer code


Side notes:

  • option batch abort and option confirm off are not necessary since 5.7 anymore (they are implicit with /command);
  • you do not need to specify port 21, it's the default port for FTP;
like image 114
Martin Prikryl Avatar answered Mar 07 '23 12:03

Martin Prikryl