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.
This topic is 13 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
4griffins
Posts: 1
Last visit: Thu Oct 14, 2010 2:32 am

Robocopy script help, please

Post by 4griffins »

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 
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Robocopy script help, please

Post by jvierra »

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
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

Robocopy script help, please

Post by jvierra »

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
This topic is 13 years and 5 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked