XCOPY的高级使用:指定日期并且用EXCLUDE排除指定文件
1.cmd到xcopyTime.bat所在目录,执行命令xcopyTime sourceFolder DestinationFolder dateTime
2.EXCLUDE.txt是排除的对象,不复制其中罗列的文件或文件夹
例子:
F:\bat>xcopyTime E:\workspace F:\website\ 06-30-2010
EXCLUDE.txt内容,在下面的线里面
------------------------------
.classpath
.class
.log
------------------------------
@echo off
rem xcopy2.BAT 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
==================================================================
.classpath
.class
.log
您可能感兴趣的文章
- 01-10使用批处理实现软件的自动安装以安装搜狗拼音为例
- 01-10通过批处理修改DNS的代码(推荐)
- 01-10再谈DOS批处理下格式化日期字符串的三种方法(详解)
- 01-10用批处理一键安装两种扩展名的Windows系统补丁
- 01-10Windows下写一个文件备份脚本(专用备份的)
- 01-10将批处理文件注册成服务在系统启动的时候自动调用
- 01-10dos批处理文件中的变量小结
- 01-10DOS中的pause命令简介
- 01-10Xcopy命令参数使用介绍
- 01-10bat+xcopy实现只复制比目标文件更新的文件