欢迎来到工商注册核名查询系统!

DOS/BAT

当前位置:主页 > 脚本语言 > DOS/BAT >

XCOPY的高级使用:指定日期并且用EXCLUDE排除指定文件

来源:本站原创|时间:2022-11-25|栏目:DOS/BAT|

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

更多DOS/BAT

您可能感兴趣的文章

阅读排行

本栏相关

随机阅读

网页制作CMS教程网络编程软件编程脚本语言数据库服务器

如果侵犯了您的权利,请与我们联系,我们将在24小时内进行处理、任何非本站因素导致的法律后果,本站均不负任何责任。

联系QQ:835971066 | 邮箱:835971066#qq.com(#换成@)

Copyright © 2002-2020 工商注册核名查询系统 版权所有