Click to See Complete Forum and Search --> : Batch problem.


Dan_Zug
July 4th, 2010, 09:50 AM
I wrote a short batch file in windows xp, who needs to copy from one directory to the other and from the other one to this one (updating all the filles from one to another):

xcopy %1 %2 /d /e /i /f /y /g /EXCLUDE:Exclude.txt
xcopy %2 %1 /d /e /i /f /y /g /EXCLUDE:Exclude.txt
pause

(I sent parameters [%1,%2] using c#)
All the copying process went well exept for the excluding, if the exclude file contains paths with spaces it won't exclude them, and those files will be copied.
Another bug that happens from time to time (not always) - the first path in Exclude.txt is copied normaly.
I read all the articals about xcopy and non of them helped me (neither using slashes or short paths ect.).

Thanks, Dan.

S_M_A
July 4th, 2010, 10:59 AM
Have you tried using " " for files containing spaces? I.e. like "c:\program files\whatever"

Dan_Zug
July 6th, 2010, 10:48 AM
Have you tried using " " for files containing spaces? I.e. like "c:\program files\whatever"

I tried it, I tried a lot of it...
I think it's a problem with the command.