I have the following backup batch file:

xcopy C:\test.txt \server\Data\user\"data test" /e /y /i

The issue is why does it not only copy the file listed but proceeds to copy the whole root directory? When i remove the switches it only copies the file. There is nothing in the description of those switches that seems to cause the behavior... They are there because I'm picking up where someone else left and all the batch files use these 3 switches.

Thanks

link|improve this question

50% accept rate
feedback

1 Answer

up vote 1 down vote accepted

According to my command line help, the e switch copies directories and subdirectories.

XCOPY source [destination] [/A | /M] [/D[:date]] [/P] [/S [/E]] [/V] [/W] [/C] [/I] [/Q] [/F] [/L] [/G] [/H] [/R] [/T] [/U] [/K] [/N] [/O] [/X] [/Y] [/-Y] [/Z] [/EXCLUDE:file1[+file2][+file3]...]

/E Copies directories and subdirectories, including empty ones. Same as /S /E. May be used to modify /T.

link|improve this answer
ahh, dropping the /e means it wont attempt the whole directory...good to know cheers – piagetblix Jun 9 '10 at 18:53
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.