Copy Files And Subdirectories With Directory Structure

Here is an example of how to copy or move the files and folders with sub-folderer XCOPY or ROBOCOPY from command line. Files can me copied or moved to a different folder or drive with exactly the same folder structure.

DOS commands used: XCOPY or ROBOCOPY

--USING robocopy
ROBOCOPY C:\ K:\SQLScriptsC *.sql /XD dirs C:\users "C:\Documents and Settings" /S /r:1 /w:1 
--USING xcopy
XCOPY C:\*.sql K:\SQLScriptsC /s /i
Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License