ftpbatch file无效login

我正在尝试创build一个简单的ftpbatch file来定期上传一些文件,但我似乎无法获得login权限。 我可以采取相同的凭据,通过Filezilla没有问题login,但从命令行不工作。

这是我正在尝试:

ECHO Creating Script File for FTP Download for District %2.... ECHO open xxx.xxx.xxx.xxx >ftp.scr ECHO myuser >>ftp.scr ECHO mypassword >>ftp.scr ECHO bin >>ftp.scr ECHO send %1 >>ftp.scr ECHO quit >>ftp.scr ftp -s:ftp.scr 

简单和我相信的点。

这是它的反应:

 D:\Suburban>ftp -s:ftp.scr ftp> open xxx.xxx.xxx.xxx Connected to xxx.xxx.xxx.xxx 220---------- Welcome to Pure-FTPd [privsep] [TLS] ---------- 220-You are user number 5 of 50 allowed. 220-Local time is now 10:16. Server port: 21. 220 You will be disconnected after 15 minutes of inactivity. User (xxx.xxx.xxx.xxx:(none)): 331 User myuser OK. Password required 530 Login authentication failed Login failed. ftp> bin 200 TYPE is now 8-bit binary ftp> send webtrn25.001 530 You aren't logged in 530 You aren't logged in ftp> quit 221-Goodbye. You uploaded 0 and downloaded 0 kbytes. 221 Logout. 

我认为这应该是直接的,但似乎没有什么是…这一定是简单的,我俯瞰。

任何投入将不胜感激!

**编辑**

我还要补充一点,如果我从命令行直接运行这些命令,我​​可以通过ftplogin:

 D:\Suburban>ftp ftp> open xxx.xxx.xxx.xxx Connected to xxx.xxx.xxx.xxx 220---------- Welcome to Pure-FTPd [privsep] [TLS] ---------- 220-You are user number 5 of 50 allowed. 220-Local time is now 10:19. Server port: 21. 220 You will be disconnected after 15 minutes of inactivity. User (xxx.xxx.xxx.xxx:(none)): myuser 331 User myuser OK. Password required Password: 230 OK. Current restricted directory is / ftp> 

我辩论删除这个,国防部可能仍然这样做,但我想清楚我的问题。 认为这可能会帮助以后的人…

 ECHO myuser >>ftp.scr ECHO mypassword >>ftp.scr 

名称/密码和>>之间的空格是问题。

一旦我改变它:

 ECHO myuser>>ftp.scr ECHO mypassword>>ftp.scr 

它工作正常!