Reputation: 135
would you please let me kno how can I copy multiple directories located in different locations to a backup directoy
sources(directories) are D:\share\t1 , D:\new\t3 , C:\media\t4 F:\save\bank destination directory is C:\shared\backup
thanks in advance
Upvotes: 8
Views: 20267
Reputation: 37569
Why not a for
loop? I love it and it is the best fit for this arcane question:
For %%a in (
"D:\share\t1"
"D:\new\t3"
"C:\media\t4"
"F:\save\bank"
) do (
xcopy /s /d "%%~a" "c:\shared\backup"
)
Upvotes: 7
Reputation: 7095
You can use a for loop to do this.
Try:
For %%a in (D:\share\t1,D:\new\t3,C:\media\t4,F:\save\bank) do xcopy %%a c:\shared\backup
Upvotes: 0