1. 编写一个xcopydate.bat,内容如下:
@echo off
rem transfers all files in all subdirectories of
rem the source drive or directory (%1) to the destination
rem drive or directory (%2)
rem lastModifyTime (%3)
xcopy %1 %2 /s /d:%3 /exclude:EXCLUDE.txt /y
if errorlevel 4 goto lowmemory
if errorlevel 2 goto abort
if errorlevel 0 goto exit
:lowmemory
echo Insufficient memory to copy files or
echo invalid drive or command-line syntax.
goto exit
:abort
echo You pressed CTRL+C to end the copy operation.
goto exit
:exit
2. 在xcopydate.bat同级目录下编写文件EXCLUDE.txt,作用是不复制原路径下罗列的文件或文件夹(每个文件或者文件夹占一行)
class
report
readme.txt
3. 运行方式如下:
c:\temp>xcopydate.bat E:\src F:\dest\ 04-30-2012
参考:
【1】xcopy与EXCLUDE参数的用法
http://blog.csdn.net/educast/article/details/5656019
【2】XCOPY的使用:指定日期并且用EXCLUDE排除指定文件
http://hi.baidu.com/mienimaer/blog/item/9c46430fbb8489276059f3f1.html