新人小白一枚,想弄个批处理文件,将FTP上子目录中的文件名保存到本地文本。目前的情况是,在DOS窗口里能遍历所有文件了,但是没有保存到文本。请大佬帮忙看看,多谢!- @echo off & color 0A
- set f_info=FTPdata.txt
- set ftpUser=userName
- set ftpPass=Password
- set ftpIP=58.215.203.29
- set ftp_path=/READ
- set LocalFolder=D:/DATACHECK
- set fname=ANST_FTP_data_list
- set time=%date:~0,4%%date:~5,2%%date:~8,2%
- set ename=.txt
- set file=%fname%%time%%ename%
-
- echo open %ftpIP% > %file%
- echo user %ftpUser% >> %file%
- echo %ftpPass%>> %file%
- echo prompt >> %file%
- echo binary >> %file%
- echo cd %ftp_path%>> %file%
-
- rem echo ls . >> %file%
-
- echo dir *.* >> %file%
-
- rem echo lcd %f_tmp% >> %file%
- echo disconnect >> %file%
- echo bye >> %file%
-
- ftp -v -n -s:%file%
-
- pause
复制代码
|