Batch file to copy directories recursively

sarsnake picture sarsnake · Nov 9, 2012 · Viewed 230.6k times · Source

Is there a way to copy directories recursively inside a .bat file? If so, an example would be great. thanks.

Answer

lc. picture lc. · Nov 9, 2012

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