Window下命令行的一些常用命令整理笔记——cmd实现ftp下载的批处理文件编写
编程中,用到从ftp上获取文件,因ftp是一个传输协议,无法直接读取其中的文件内容,只能进行下载。 此处,使用cmd的方法,来下载ftp上的文件( 在下方,后面附加解释说明) @ set nowdate= % date:~0 , 4% % date:~5 , 2% % date:~8 , 2 % @ set txtPath=D: / / ftptmp . txt @ set sourcePath=txt / file @ set destPath=D:\txt\ % date:~0 , 4 % \ % date:~5 , 2 % \ % date:~8 , 2 % if not exist % destPath % md % destPath % @ echo on echo open 192 . 168 . 0 . 1> % txtPath % echo weather>> % txtPath % echo weather1>> % txtPath % echo cd % sourcePath % >> % txtPath % echo prompt>> % txtPath % echo lcd % destPath % >> % txtPath % echo mget * % nowdate% * . TXT>> % txtPath % echo on ftp - s: %