0

I'm trying to create a simple script that will robocopy several folders using the command below. When one folder is done copying, it moves on to the next. Does anyone have a batch/powershell for loop example for this? I've searched around but couldn't find anything.

robocopy “\\SOURCESERVER\FOLDER\” “\\DESTSERVER\FOLDEr” /S /E /COPY:DATS

RomeNYRR
  • 1,441
  • 11
  • 16

1 Answers1

4

I don't quite understand your question but it seems to me that it's a simple matter of creating a batch file thusly:

robocopy “\SOURCESERVER\FOLDER1\” “\DESTSERVER\FOLDER1” /S /E /COPY:DATS

robocopy “\SOURCESERVER\FOLDER2\” “\DESTSERVER\FOLDER2” /S /E /COPY:DATS

robocopy “\SOURCESERVER\FOLDER3\” “\DESTSERVER\FOLDER3” /S /E /COPY:DATS

joeqwerty
  • 109,901
  • 6
  • 81
  • 172
  • Hi Joe, thanks for the response. To clear things up, I just want to create a batch script that will run exactly what you posted above, in order. If I were to put that in a script, would it complete FOLDER1 copy and then move on to FOLDER2 when it's done, or would it kick them all off at the same time? – RomeNYRR Dec 17 '12 at 19:40
  • A batch file like the one above would process one line at a time in order. So it would process line 1 and then when line 1 completes it will process line 2, etc. – joeqwerty Dec 17 '12 at 19:47
  • Glad to help... – joeqwerty Dec 17 '12 at 20:03