本篇内容主要讲解“如何用XCOPY实现指定日期并且用EXCLUDE排除指定文件”,感兴趣的朋友不妨来看看。本文介绍的方法操作简单快捷,实用性强。下面就让小编来带大家学习“如何用XCOPY实现指定日期并且用EXCLUDE排除指定文件”吧!
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
到此,相信大家对“如何用XCOPY实现指定日期并且用EXCLUDE排除指定文件”有了更深的了解,不妨来实际操作一番吧!这里是编程网网站,更多相关内容可以进入相关频道进行查询,关注我们,继续学习!