Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to copy multiple files to a folder using xcopy

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

like image 652
user2434611 Avatar asked May 30 '13 01:05

user2434611


1 Answers

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"
  )
like image 161
Endoro Avatar answered Sep 25 '22 22:09

Endoro