S
S
susnake2015-01-19 12:08:55
cmd/bat
susnake, 2015-01-19 12:08:55

Why does the script for sending files via FTP using BAT not work?

Win7 is installed on the client machine.
On an Ubuntu 14.04 server with VSFTPD.
When I launch the console on the client machine and try to connect via FTP, it turns out.
But I would like to automate the actions and for this I made a small batch file

ftp -s:enter.txt -i 192.168.5.3
cd 1C
mput C:\Users\sya\Desktop\Documents.rar

In the same folder where I run the *.bat file, there is enter.txt with a list of commands:
MyLogIn
MyPassword
cd 1C
mput C:\Users\sya\Desktop\Documents.rar

But when I run the *.bat file, the console writes to me:
C:\Users\sya>ftp -s:enter.txt -i 192.168.5.3
ошибка открытия файла макросаenter.txt

Обмен файлами с компьютером, на котором запущена служба
сервера FTP. FTP может использоваться интерактивно.

FTP [-v] [-d] [-i] [-n] [-g] [-s:имя_файла] [-a] [-A] [-x:sendbuffer]
    [-r:recvbuffer] [-b:asyncbuffers] [-w:windowsize] [узел]

If I write the hard way
ftp -s:C:\Users\sya\Desktop\enter.txt -i 192.168.5.3
cd 1C
mput C:\Users\sya\Desktop\Documents.rar

, then:
C:\Users\sya>ftp -s:"C:\Users\sya\Desktop\enter.txt" -i 192.168.5.3
Связь с 192.168.5.3.
220 (vsFTPd 3.0.2)
Пользователь (192.168.5.3:(none)):
331 Please specify the password.

530 Login incorrect.
Сбой входа.
ftp> cd 1C
530 Please login with USER and PASS.
ftp> mput C:\Users\sya\Desktop\Documents.rar
C:\Users\sya\Desktop\Documents.rar:
ftp>

I tried to do as it is written on stackoverflow , but something didn't work out either.
And I can't figure out where I went wrong.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
susnake, 2015-01-19
@susnake

Shaw for nonsense?
I put my home IP in the * .bat file, on which my FTP server is running. I registered data from my server in enter.txt, launched the bat-logged in.
I returned everything to bat and txt as it was, launched it - everything went in and copied 0_o

C:\Users\sya\Desktop>ftp -s:C:\Users\sya\Desktop\enter.txt -i 192.168.5.3
Связь с 192.168.5.3.
220 (vsFTPd 3.0.2)
Пользователь (192.168.5.3:(none)):
331 Please specify the password.

230 Login successful.
ftp> cd 1C
250 Directory successfully changed.
ftp> mput C:\Users\sya\Desktop\Documents.rar
C:\Users\sya\Desktop\Documents.rar:
ftp>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question