XCOPY – copy entire directories in MS-DOS

To copy entire directories in MS-DOS, use the XCOPY command. For example, the following command
XCOPY c:\photos d:\ /s /e /c /h
will copy the “photos” directory from C drive to D drive. The nice part about the “/c” option is that it will keep copying the files even if some of them are corrupted. Please see the links below for detailed information about the options:
Microsoft TechNet
Wikipedia
The reason I searched for the XCOPY command is that I was backing up files from one network drive to another. And I realized that using the Windows based copy command was cumbersome because several of the files I was copying were corrupted. As a result, I was having to manually examine which files were not copied and copy them again. This was consuming a lot of time for me. The XCOPY syntax given above worked like a breeze. It copied the entire folder and ignored the files which were corrupted. In Unix/Linux, you would achieve the same by using the “cp -ap” command. More Unix/Linux commands are here.