简体   繁体   English

Bat文件FTP命令

[英]Bat File FTP Commands

I am attempting to download a file via FTP in a batch file. 我正在尝试通过FTP以批处理文件下载文件。 The solution is very similar to this previous question . 解决方案与之前的问题非常相似。 The only difference is that I'm getting an error of "501 Server Cannot Accept Argument". 唯一的不同是,我收到“ 501服务器无法接受参数”错误。

Here is the code of my bat file: 这是我的蝙蝠文件的代码:

@echo off
echo user removed> ftpcmd.dat
echo removed>> ftpcmd.dat
echo CD /removed.com/assets/csv/>> ftpcmd.dat
echo LCD C:\Temp >> ftpcmd.dat
echo TYPE>> ftpcmd.dat
echo GET valid_file.php new.php>> ftpcmd.dat
echo quit>> ftpcmd.dat
ftp -n -s:ftpcmd.dat removed.com
del ftpcmd.dat

Here is the output of my bat file running: 这是我的bat文件运行的输出:

c:\Temp>test
Connected to removed.com.
220 Microsoft FTP Service
ftp> user removed
331 Password required for removed.

230 User logged in.
ftp> CD /removed.com/assets/csv/
250 CWD command successful.
ftp> LCD C:\Temp
Local directory now c:\Temp.
ftp> TYPE
Using ascii mode to transfer files.
ftp> GET valid_file.php new.php
501 Server cannot accept argument.
150 Opening ASCII mode data connection.

try 尝试

 MGET valid_file.php new.php >> ftpcmd.dat

leave the new.php or do that later. 离开new.php或稍后再做。

UNless of course is a network error, in which case you need to add the proper ports. 除非是网络错误,否则在这种情况下,您需要添加适当的端口。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM