本帖最后由 luxmj 于 2016-7-13 09:41 编辑
根据论坛内的代码借鉴(抄袭)
已经成功实现FTP下载指定文件,但是就是无法正确解压
删除FTP代码后也能解压,但是两部分组合到一起后就无法解压了
请各位指教- @echo off
- set ftpUser=abc
- set ftpPass=123
- set ftpIP=ftp.abc.com
- set ftpFolder=/ARD
- for /f "tokens=2 delims==" %%a in ('wmic path win32_operatingsystem get LocalDateTime /value') do (set t=%%a)
- set Today=%t:~0,4%-%t:~4,2%-%t:~6,2%
- set myFile=J_DB_%Today%
- set LocalFolder=D:\10000
- set rarFolder=D:\Cer
- set RarPath=C:\Program Files\WinRAR
- set ftpFile=%temp%\dbftp.txt
- >"%ftpFile%" echo,%ftpUser%
- >>"%ftpFile%" echo,%ftpPass%
- >>"%ftpFile%" echo cd "%ftpFolder%"
- >>"%ftpFile%" echo lcd "%LocalFolder%"
- >>"%ftpFile%" echo bin
- >>"%ftpFile%" echo mget %myFile%.rar
- >>"%ftpFile%" echo bye
- start ftp -v -i -s:"%ftpFile%" %ftpIP%
- ::path C:\WINDOWS\system32
- "%RarPath%\Rar.exe" x -t -o "%LocalFolder%\%myFile%.rar" "%rarFolder%"
复制代码
|