FTP Download File By Some Order List
@Echo Off
REM -- Define File Filter, i.e. files with extension .RB
Set FindStrArgs=/E /C:".asp"
REM -- Extract Ftp Script to create List of Files
Set "FtpCommand=ls"
Call:extractFileSection "[Ftp Script 1]" "-">"%temp%\%~n0.ftp"
REM Notepad "%temp%\%~n0.ftp"
REM -- Execute Ftp Script, collect File Names
Set "FileList="
For /F "Delims=" %%A In ('"Ftp -v -i -A -s:"%temp%\%~n0.ftp"|Findstr %FindStrArgs%"') Do (
Call Set "FileList=%%FileList%% "%%A""
)
REM -- Extract Ftp Script to download files that don't exist in local folder
Set "FtpCommand=mget"
For %%A In (%FileList%) Do If Not Exist "%%~A" Call Set "FtpCommand=%%FtpCommand%% "%%~A""
Call:extractFileSection "[Ftp Script 1]" "-">"%temp%\%~n0.ftp"
REM Notepad "%temp%\%~n0.ftp"
For %%A In (%FtpCommand%) Do Echo.%%A
REM -- Execute Ftp Script, download files
ftp -i -s:"%temp%\%~n0.ftp"
Del "%temp%\%~n0.ftp"
GOTO:EOF
:extractFileSection StartMark EndMark FileName -- extract a section of file that is defined by a start and end mark
:: -- [IN] StartMark - start mark, use '...:S' mark to allow variable substitution
:: -- [IN,OPT] EndMark - optional end mark, default is first empty line
:: -- [IN,OPT] FileName - optional source file, default is THIS file
:$created 20080219 :$changed 20100205 :$categories ReadFile
:$source http://www.dostips.com
SETLOCAL Disabledelayedexpansion
set "bmk=%~1"
set "emk=%~2"
set "src=%~3"
set "bExtr="
set "bSubs="
if "%src%"=="" set src=%~f0& rem if no source file then assume THIS file
for /f "tokens=1,* delims=]" %%A in ('find /n /v "" "%src%"') do (
if /i "%%B"=="%emk%" set "bExtr="&set "bSubs="
if defined bExtr if defined bSubs (call echo.%%B) ELSE (echo.%%B)
if /i "%%B"=="%bmk%" set "bExtr=Y"
if /i "%%B"=="%bmk%:S" set "bExtr=Y"&set "bSubs=Y"
)
EXIT /b
[Ftp Script 1]:S
!Title Connecting...
open 12.130.50.110
!Title Preparing...
cd /
lcd D:\Root
binary
hash
!Title Processing... %FtpCommand%
%FtpCommand%
!Title Disconnecting...
disconnect
bye
FTP Download File By Some Order List的更多相关文章
- [Powershell] FTP Download File
# Config $today = Get-Date -UFormat "%Y%m%d" $LogFilePath = "d:\ftpLog_$today.txt&quo ...
- FTP(File Transfer Protocol)是什么?
文件传输协议 FTP(File Transfer Protocol),是文件传输协议的简称.用于Internet上的控制文件的双向传输.同时,它也是一个应用程序(Application).用户可以通过 ...
- Csharp:WebClient and WebRequest use http download file
//Csharp:WebClient and WebRequest use http download file //20140318 塗聚文收錄 string filePath = "20 ...
- Bind Mounts and File System Mount Order
When you use the bind option of the mount command, you must be sure that the file systems are m ...
- C# show FTP Download/Upload progress
https://stackoverflow.com/questions/4591059/download-file-from-ftp-with-progress-totalbytestoreceive ...
- python ftp download with progressbar
i am a new one to learn Python. Try to download by FTP. search basic code from baidu. no one tells h ...
- Download file using libcurl in C/C++
http://stackoverflow.com/questions/1636333/download-file-using-libcurl-in-c-c #include <stdio.h&g ...
- httpClient download file(爬虫)
package com.opensource.httpclient.bfs; import java.io.DataOutputStream; import java.io.File; import ...
- Spring boot download file
Springboot对资源的描述提供了相应的接口,其主要实现类有ClassPathResource.FileSystemResource.UrlResource.ByteArrayResource. ...
随机推荐
- 死磕nginx系列--nginx 目录
死磕nginx系列--nginx入门 死磕nginx系列--nginx配置文件 死磕nginx系统-nginx日志配置 死磕nginx系列--nginx服务器做web服务器 死磕nginx系列--使用 ...
- CF1045G:AI robots(CDQ分治)
Description 火星上有$n$个机器人排成一行,第$i$个机器人的位置为$x_i$,视野为$r_i$,智商为$q_i$.我们认为第$i$个机器人可以看到的位置是$[x_i−r_i,x_i+ ...
- About me?
看到好像每一篇博客都要写这个东西,就跟风写一写吧 写点啥啊 一个来自SD slyz的彩笔,就是天天被锤爆的那种 因为经常表现自己的弱还被一些大佬嘲讽说\(fake\) 啥都不擅长 可能很快就退役了 这 ...
- Qt Creator中根据为Windows系统还是Linux系统对源码进行条件编译
方法1: 在.h和.cpp文件中,针对需要不同平台编译的代码:添加上如下的条件编译指令: #ifdef 标识符 程序段1 #else 程序段2 #endif 举例说明如下: //Windows系统包含 ...
- Python脱产8期 Day02
一 语言分类 机器语言,汇编语言,高级语言(编译和解释) 二 环境变量 1.配置环境变量不是必须的2.配置环境变量的目的:为终端提供执行环境 三Python代码执行的方式 1交互式:.控制台直接编写运 ...
- Echo团队Alpha冲刺随笔 - 第四天
项目冲刺情况 进展 前端:完成了差不多一半,小程序部分界面基本完工,WEB端也完成了一部分 后端:也完成了大半了 问题 后端文件上传还没解决 心得 进度还行,团队配合都还不错 今日会议内容 黄少勇 今 ...
- Android使用属性动画ValueAnimator动态改变SurfaceView的背景颜色
以下是主要代码,难点和疑问点都写在注释中: /** * 开始背景动画(此处为属性动画) */ private void startBackgroundAnimator(){ /* *参数解释: *ta ...
- SkylineGlobe 6.5 如何实现简单多边形的动态绘制 C#示例代码
在Skyline的TEPro软件中,我们可以很容易地绘制出多边形. 那么,在二次开发过程中,该如何绘制一个简单的多边形呢? 通过下面的示例代码,我们可以很容易完成这一项工作. 其中,重点需要了解Geo ...
- SSL踩坑ERR_SSL_VERSION_OR_CIPHER_MISMATCH
最近公司项目开发了一个微信小程序,并且部署测试OK,由于微信小程序调用的后端接口必须是HTTPS,所以给接口安装了SSL,第一天测试都正常.第二天早上再使用时页面无响应. 抓包发现是后端接口抛出: n ...
- Verilog对数据进行四舍五入(round)与饱和(saturation)截位
转自https://www.cnblogs.com/liujinggang/p/10549095.html 一.软件平台与硬件平台 软件平台: 操作系统:Windows 8.1 64-bit 开发套件 ...