I have a batch file that ftps a load of txt file across to a different server.
My Original batch file was as follows:
@echo off
echo user MyUser> ftpcmd.dat
echo MyPassWord>> ftpcmd.dat
echo bin>> ftpcmd.dat
echo lcd C:\MyFolder>>ftpcmd.dat
echo mput *.txt>> ftpcmd.dat
echo quit>> ftpcmd.dat ftp -i -n -s:ftpcmd.dat [ServerIP]
del ftpcmd.dat
del C:\MyFolder\*.txt
We are using Filezilla and when this runs we now get an error:
This server does not allow plain FTP. You have to use FTP over TLS
Having found this post: Secure FTP using Windows batch script
I updated the batch file to
@echo off
echo open ftpes://MyUser:MyPassword@[ServerIP] >> ftpcmd.dat
echo bin>> ftpcmd.dat
echo lcd C:\MyFolder>>ftpcmd.dat
echo mput *.txt>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -i -n -s:ftpcmd.dat [SERVERIP]
del ftpcmd.dat
del C:\MyFolder\*.txt
This gives the errors:
Already connected to [ServerIP], use disconnect first
Please log in with USER and PASS first
I know I have lost my way somewhere and quite possibly misinterpreting the other post but I'm not sure quite what I'm doing wrong. I don't think the two errors are related (although they may be) so I think the main question is
How do I login with USER and PASS first?