How to write script for SSL FTP connection

Advertisement

ttian
Guest

How to write script for SSL FTP connection

open ftp://user:1password@ftpsite.com
waiting for welcome message
connection failed
connection failed
policy requires SSL


assume the command line is incorrect.

Reply with quote

Advertisement

ttian
Guest

script runs but won't upload files

here is the script:

winscp ftp://user:password@myftp.com /explicitssl
option batch abort
option confirm off
option transfer binary
put c:\test\*
close
exit

the site will connected, after it nothing going on. (from "option batch abort" below nothing runs)

please help! thank you!

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
40,476
Location:
Prague, Czechia

Re: script runs but won't upload files

ttian wrote:

here is the script:

winscp ftp://user:password@myftp.com /explicitssl
option batch abort
option confirm off
option transfer binary
put c:\test\*
close
exit
What kind of script is this? While the first line is Windows command (to run WinSCP), the rest are WinSCP commands. You cannot combine these in a single file/script.

Please start again with:
https://winscp.net/eng/docs/scripting
https://winscp.net/eng/docs/guide_automation

Reply with quote

Guest

Hi Prikryl,

Thank you for your reply. The actual script as below:

winscp ftp://user:password@myftp.com /explicitssl
option batch abort
option confirm off
option transfer binary
put c:\test\*
close
exit


when I run it, it shows the site connects, and then stop there, which means the rest of commands won't run. I'm kind of stuck here.

Please help! Thanks again!

Reply with quote

martin
Site Admin
martin avatar

First, I already suggested you that you cannot combine Windows command (to run WinSCP) and WinSCP commands in one script. What obviously your script is doing. Second, you did not answer my question. What kind of script the above is? Is is a .bat file? If it is, make sure you move the remaining commands to a WinSCP script file and reference the file from WinSCP command-line. For that refer to the links I've posted earlier.

Reply with quote

Advertisement

You can post new topics in this forum