I'm ftping in to an Adrive.com account to upload a backup file. I do not know the version of linux that is installed. I tried to get the version with these commands:
ftp> uname -r
Invalid command.
ftp> cat /etc/*-release
Invalid command.
ftp> lsb_release -a
Invalid command.
ftp> cat /proc/version
Invalid command.
ftp> uname -a
Invalid command.
As you can see none of them worked.
Here is my script that I'm trying to run:
ECHO open ftp://xxx:[email protected]>FTPSND.TXT
echo cd backup>>FTPSND.TXT
echo cd companyfiles>>FTPSND.TXT
echo mkdir %3>>FTPSND.TXT
echo cd %3>>FTPSND.TXT
echo option transfer binary>>FTPSND.TXT
ECHO send %1>>FTPSND.TXT
ECHO close>>FTPSND.TXT
ECHO exit>>FTPSND.TXT
winscp.com /script=ftpsnd.txt >>%2
And the error that is happening on the mkdir:
Error creating folder 'BEL'.
File or directory already exists.
(A)bort, (R)etry, (S)kip: Abort
My main problem is that if the directory does not exist, I need to create it, otherwise I skip that step and move on to the send.
Any ideas how I get around this?
EDIT
In response to Hackoo:
I failed to mention that this batch file is called from another batch file close to the end. When I used your code, I am not getting the file uploaded and the log shows:
ftp> Open ftp.adrive.com
Connected to ftp.adrive.com.
220 Username is your email address used for web interface
User (ftp.adrive.com:(none)):
331 Username OK, please send password.
230 Welcome xxxxx
ftp> prompt n
Interactive mode Off .
ftp> bin
200 TYPE changed to I.
ftp> MkDir /backup/companyfiles/IFC
550 File or directory already exists.
ftp> cd /backup/companyfiles/IFC
250 Changed directory OK.
ftp> mput D:\SSSAVES\sssbackup\TMPDIR\IFC_20160705141154.ZIP
200 PORT command OK.
150 Opening BINARY mode data connection for file IFC_20160705141154.ZIP.
It is not moving from this point and doing anything. I let it sit there for 2 hours just to make sure. The file is only 70mb in size so I doubt it would take that long.
EDIT #2
The file did eventually show up on Adrive, so I believe the ftp mput is working. It just doesn't seem to be releasing after it is sent
EDIT #3
I did change it from mput to put since I am only sending 1 file. That did not make a difference.

if not exist %3 mkdir %3ftp> if not exist %3 mkdir %3Invalid command.if not existwill not work as an ftp command.