回复 1# emoboy - @echo off
- set DaysAgo=1
- for /f %%i in ('powershell -c "Get-Date (Get-Date).AddDays(-%DaysAgo%) -uformat "%%Y%%m%%d""') do (
- set "DstDate=%%i"
- )
-
- rem 指定FTP用户名
- set "ftpUser=dsserver"
- rem 指定FTP密码
- set "ftpPass=hdsserver"
- rem 指定FTP服务器地址
- set "ftpIP=21.98.130.208"
- rem 指定待下载的文件位于FTP服务器的哪个目录
- set "ftpFolder=/usr/dsserver/print/%DstDate%"
- rem 指定从FTP下载下来的文件存放到本机哪个目录
- set "LocalFolder=E:\zfprt"
-
- set ftpFile=%temp%\TempFTP.txt
- >"%ftpFile%" (
- echo,%ftpUser%
- echo,%ftpPass%
- echo cd "%ftpFolder%"
- echo lcd "%LocalFolder%"
- echo bin
- echo mget *.*
- echo bye
- )
- start ftp -v -i -s:"%ftpFile%" %ftpIP%
复制代码
|