近期因为工作需要,经常要根据文件清单批量查找文件并复制到指定文件夹,手动操作十分繁琐。因此,参考本站文章编写了一个文件批量查找与复制的批处理程序。
参考文章:http://t.csdnimg.cn/aNciG
本文程序的主体代码来自上方参考文章,与其相比增加了手动输入相关参数的功能。
1、程序代码
@echo off
setlocal enabledelayedexpansion
echo -------------------------------- BEGIN ----------------------------------
rem set parameter here
rem dirCopy: 0-file copy, 1-directory copy
rem path do not end with backslash
rem sourcePath only support one path when use directory copy, multi path(separated by semicolons and make sure all path is exist) is available when use file copy
rem eg:
rem file copy:
rem set sourcePath=C:\Users\Desktop\test 1;C:\Users\Desktop\test2
rem set targetPath=C:\Users\Desktop\target
rem set fileList=list.txt
rem set dirCopy=0
rem directory copy:
rem set sou