The edevil windows-cmd, xcopy, exclude list

Source: Internet
Author: User

Tonight I face a very strange problem, when trying to copy the project binary file tree to my Linux system for testing, some part of the directory is missing. I check the batch file which handle the copy task, found out I use the 'xcopy' command, with a exclude
List. I have examining the exclude.txt file quite of careful, but can't find any problems. finally, I notice that the missing directory, name 'tool', underneath has two text files, those are 'makeinc. bat 'and 'make _ Inc. sh', And I delete the excluding item
One by one, and notice the changes, finally I found out that under the exclude.txt file, there is a item name 'inc' really take the effect, so I understand what is going on. 'inc' in fact is a folder name, that I really want to skip copying, but this seach
Condition also match the file named with 'make _ Inc. sh' and 'makeinc. bat ', so when xcopy meet those files, and skip copy, also skip the upper folder that contain these (and only these) two items. if we want to use xcopy with a exclude list, the folder or file
Names has the same search key word wocould be skipped, that's a really tragic.

But fortunately, there is a solution, when escaping directories or folders, try to use the word '\ Inc \' but not the word 'inc', notice there are two back slash being added, this will guarantee the searching app always match the key word with directories names
But not the file names, it's good!

Related Article

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.