Robocopy script help, please

Batch, ASP, JScript, Kixtart, etc.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
4griffins
Posts: 1
Joined: Thu Oct 14, 2010 2:24 am

Robocopy script help, please

Post by 4griffins » Thu Oct 14, 2010 2:32 am

I am trying to find a way to minimize this script. Below is 3 different lines that are I need to set up for 50 different locations. The path will be exactly the same for all 50 locations except for the server name is different for all of them. Is there an easy way to make this happen without having 150 different "start Robocopy" lines? Thanks!

Code: Select all

start Robocopy "JacksonVol5Sitedata" "JacSiteStudentSitedata" /B /SEC /MIR /R:5 /W:15 /LOG:JacLogfile1.txt /NFL /NDL
start Robocopy "JacksonVol5Appinst" "JacSiteStudentSitedataAppinst" /B /SEC /MIR /R:5 /W:15 /LOG:JacLogfile2.txt /NFL /NDL
start Robocopy "JacksonVol6userstudent" "JacUserStudent" /B /SEC /MIR /R:5 /W:15 /LOG:JacLogfile3.txt /NFL /NDL 

User avatar
jvierra
Posts: 13280
Joined: Tue May 22, 2007 9:57 am
Contact:

Robocopy script help, please

Post by jvierra » Thu Oct 14, 2010 4:44 am

robocopy is not scripting it is just using the command line. When you put a string of commands in a file with extensions of BAT or CMD you are creating a command batch.

At a prompt type for /? which will list the help for the batch command FOR. There are examples in the help.


jvierra2010-10-14 11:44:49

User avatar
jvierra
Posts: 13280
Joined: Tue May 22, 2007 9:57 am
Contact:

Robocopy script help, please

Post by jvierra » Thu Oct 14, 2010 5:40 am

You might also want to note that robocpy has many command line switches that let you copy mutliple sources and destinations in one line. These can also help when we need to specify multiple systems.

You might also want to look into the GUIs that help generate RoboCopy batch files.

Here is one:http://betterrobocopygui.codeplex.com/

and more
http://www.google.com/search?hl=en&sour ... oEBU_QEMcC

Locked