I am trying to run xcopy that copies files excluding .obj, etc. What I am seeing is that Microsoft.Practices.ObjectBuilder.dll is not copied when my excludes.txt file contains .obj as an extension. When .obj is removed, I Microsoft.Practices.ObjectBuilder.dll is copied correctly. This does not happen to other dlls though.
Does anyone have any idea why this would happen?
Thanks!
Lenik
Yeah, xcopy is dumb like that.
Do this:
dir /b *.obj >excludes.txt
xcopy * /exclude:excludes.txt targetdir
although this will still have the problem sometimes.
If you had a file called practices.obj, for example, it wouldn't copy that, but it would also fail to copy your Microsoft.Practices.ObjectBuilder.dll
A handy trick is if you specify /s on dir, you get recursion and the full path, then if you specify the source directory fully on the xcopy, the excludes will have to match from the beginning:
dir /s /b *.obj >excludes.txt
xcopy c:\sourcedir\* /exclude:excludes.txt \targetdir
Now Microsoft.Practices.ObjectBuilder.dll would only fail to copy if you happen to have a Microsoft.Practices.obj file in the same directory. Get it?
I guess because the substring .obj is found in the name Microsoft.Practices**.Obj**ectBuilder.dll and since windows is not case sensitive, it will exclude it.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With