Hi,
I have my vendor's ftp url over SSL. it's like ftps://myvendor.com and i have username and password. So please help me on writing batch script t o downlod the file from my vendor repository.
If this is not possible in dos script, please suggest me opensource tool. But i would love the solution in dos script as i need to use this forever to avoid any manual work.
Thanks
I want to use secure FTP in a script
Moderator: DosItHelp
Re: Help Need in batch script
Windows ftp cannot do ftp with TLS or SSL.
I would look at using psftp or winscp. One of those should work.
I would look at using psftp or winscp. One of those should work.
-
- Posts: 51
- Joined: 16 Nov 2014 20:28
Re: I want to use secure FTP in a script
Hi Squashman,
thanks for your reply. Here is my try
I tried to make below code with the file name as "connection.txt"
in the place of username,pwd,url i supplied my actual values. Also i am trying to download all the file as a test and used *.* ./
Then i called the winscp exe using below code
Is there anything am doing wrong? please help me on giving the workable script.
Thanks
thanks for your reply. Here is my try
I tried to make below code with the file name as "connection.txt"
Code: Select all
# Automatically abort script on errors
option batch abort
# Disable overwrite confirmations that conflict with the previous
option confirm off
# Connect with username and password
open sftp://username:pwd: https://ftps.domain.com/
# Change local directory
lcd D:\Test\FTPS\
# Force binary mode transfer
option transfer binary
# Download missing files to local directory from remote
get “*.*” .\
# Disconnect
close
# Exit WinSCP
exit
in the place of username,pwd,url i supplied my actual values. Also i am trying to download all the file as a test and used *.* ./
Then i called the winscp exe using below code
Code: Select all
D:\Test\winscp570\WinSCP.exe /console /script="D:\Test\winscp570\connection.txt" /log="D:\Test\winscp570\conn.log"
Is there anything am doing wrong? please help me on giving the workable script.
Thanks
Re: I want to use secure FTP in a script
I have never used either one. I just know what they can do.
But it looks to me like you are mixing protocols. This makes no sense at all.
But it looks to me like you are mixing protocols. This makes no sense at all.
Code: Select all
open sftp://username:pwd: https://ftps.domain.com/
Re: I want to use secure FTP in a script
Based on the official WinSCP documentation, i would guess the open line should look like this:
penpen
Code: Select all
open sftp://username:pwd@ftps.domain.com/
penpen