xcopy files and directory

Posted by user1044937 on Super User See other posts from Super User or by user1044937
Published on 2011-11-14T06:30:04Z Indexed on 2011/11/14 9:58 UTC
Read the original article Hit count: 225

Filed under:
|
|

I have a folder named "C:\Jobs\job#1" , "C:\Jobs\job#2" "C:\Jobs\job#3" etc and a lot of directories and sub-directories under it. I want to get the all the directories under Jobs and xcopy them to C:\backup. Then I want to xcopy all the files under each Job#1, 2 ,3 etc. to C:\backup\job#1\month\\*.* To make it clearer.

Source dir = C:\Jobs\job#1\"myfiles&dir"

Destination  dir = C:\Backup\job#1\month\"myfiles&dir"

then do the next folder

Source dir = C:\Jobs\job#2\"myfiles&dir"

Destination dir = C:\Backup\job#2\month\"myfiles&dir"

...until all folders are back-up. Since the job folder keep increasing, by doing it this way I don't have to add extra code on this script except modify the month. Thank you.

© Super User or respective owner

Related posts about copy

Related posts about command-line