批处理 把文本中指定的文件从一个目录复制到另外一个目录

来源:互联网 发布:软件编程自学 编辑:程序博客网 时间:2024/04/28 04:24

1.---------------------------------------------------- list.txt表中的数据 ----------------------------------------------------

   M /branches/Test服务器/a1/a11.txt
   M /branches/Test服务器/a1/a12.txt
   A /branches/Test服务器/a1/a2/a22.txt
   A /branches/Test服务器/b1/b11.txt
   A /branches/Test服务器/c1/c2/c22.txt
   A /branches/Test服务器/c1/c11.jpg
   A /branches/Test服务器/c1/c12.fla
   A /branches/Test服务器/c1/c2/c23.txt
   A /branches/Test服务器/d1/d2/d3/d33.txt
   M /branches/Test服务器/a1/a3/a4/a44.txt

2.表中数据来源本地SVN工作副本与版本库之间的差异文件

svn log -r BASE:HEAD -v>tmp.txt | findstr "A M" >list.txt

cd /d 工作目录

svn up

3.生成差异补丁包

@echo off

setlocal enabledelayedexpansion
set workCopy=E:\Test服务器
set patchDir=E:\serverPatch
for /f "tokens=2 delims= " %%s in (list.txt) do (
set dirName=%%~ps
set fileName=%%~pnxs
set fileName=!fileName:~17!
set dirName=!dirName:~17!
rem echo !fileName!
rem echo !dirName!
xcopy !workCopy!!fileName! !patchDir!!dirName! /y
)
原创粉丝点击