2013-04-25 49 views
0

我做了一个FTP脚本,但我需要记录传输 特别是远程FTP上的文件列表(ls或dir的结果) 现在我只获得一个日志FTP命令,而不是结果如何从FTP登录目录

get.bat

ftp -v -n -i -s:D:\AX\get.ftp >>D:\AX\ftplog.txt 

get.ftp

open ftp.xxxxxx.xx 
user xxxxxxx 
xxxxxxxx 
binary 
cd /OUT 
ASCII 
ls >>D:\AX\ftplog.txt 
lcd "\Import" 
mget *.* s 
mdelete *.* 
bye 

结果:

open ftp.xxxxxx.xx 
user xxxxxx 
binary 
cd /OUT 
ASCII 
ls >>D:\AX\ftplog.txt 
lcd "\Import" 
mget *.* s 
bye 

,我想看到的是:

230 Login successful. 
ftp> dir 
200 PORT command successful. Consider using PASV. 
150 Here comes the directory listing. 
drwxrwxrwx 2 ftp  ftp   4096 Apr 25 10:10 IN 
drwxrwxrwx 2 ftp  ftp   4096 Apr 24 15:39 OUT 
226 Directory send OK. 
ftp: 121 bytes received in 0,02Seconds 7,56Kbytes/sec. 

怎么做呢

+0

那必须是Windows删除参数,而不是DOS吧? – 2013-04-25 13:16:03

回答

2

阅读FTP -?并注意-v参数,根据该文件,意味着

-v禁止显示远程服务器响应。

因此,在命令行

ftp -n -i -s:D:\AX\get.ftp >>D:\AX\ftplog.txt