views:

957

answers:

1

Hey,

I have a batch file I've created which uses xcopy to copy a dir, and child dirs, and merge them into one file. (ie. all my modulised development css stylesheets merged into one production stylesheet).

Everything is good, apart from the fact that when I reference the excludelist.txt, it only excludes the first line, and not the subsequent files I want excluded.

Anyone fancy a crack at this? You'd be most helpful.

Here's the code:

XCOPY C:\xampp\htdocs\PROJECT\css\*.* C:\temp /S /I /Y /EXCLUDE:C:\xampp\htdocs\PROJECT\exclude.txt

...and inside my exclude.txt is...

1.css
2.css
3.css
4.css
5.css

///// I know the code works (to an extent) because it is infact excluding file 1.css -- just not the ones below it. Am I right to put each exclusion on a new line?

A: 

You seem to be using xcopy correctly - each exclusion file (or match depending on wildcards) should be on a new line within the file. So far I've been unable to reproduce the behaviour you're experiencing.

Is the exclude.txt listing you've given above a test file, or are they the actual css names?
What are the names of the other files that your batch file is supposed to copy?

Edit:
That the xcopy is failing to exclude further files after a single match is giving me most pause. I thought it might be to do with the type of carriage-return that was used in the exclude file, but xcopy handles unix-style carriage-returns just fine.

Can you re-verify that the correct exclude file is being used?

Andy
Hey Andy,1.css, 2.css etc are just file names to illustrate the problem.The other names of the files that the batch is supposed to copy are all english names, no spaces, no special characters (apart from a '-' (dash).Hope you have a little more insight. I'm stumped!
davebowker
Were you perhaps using U+000A as line separator, instead of U+000A U+000D?
Joey
I just hit enter to get a new line. Nothing fancy.
davebowker