Advanced use of xcopy: Specify a date and exclude the specified file with exclude _dos/bat

Source: Internet
Author: User
Tags goto
1.cmd to Xcopytime.bat directory, execute command xcopytime sourcefolder destinationfolder dateTime
2.exclude.txt is an excluded object and does not copy the files or folders listed in it

Example:
F:\bat>xcopytime E:\workspace F:\website\ 06-30-2010

EXCLUDE.txt content, in the line below

------------------------------
. classpath
. class
. log
------------------------------



Copy Code code as follows:

@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 Errorle Vel 4 goto lowmemory
if errorlevel 2 goto abort
if errorlevel 0 goto exit
: Lowmemory
Echo insuffic Ient 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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.