Search code examples
batch-filecopy

Batch file to copy directories recursively


Is there a way to copy directories recursively inside a .bat file? Is an example of this available?


Solution

  • Look into xcopy, which will recursively copy files and subdirectories.

    There are examples, 2/3 down the page. Of particular use is:

    To copy all the files and subdirectories (including any empty subdirectories) from drive A to drive B, type:

    xcopy a: b: /s /e