I have the following backup batch file:

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

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 three switches.


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]

  **/E           Copies directories and subdirectories, including empty ones.
               Same as /S /E. May be used to modify /T.**
| 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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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