Copy Files to Multipe Locations with Robocopy


1. Prepare a destination list with one item each line and save it to the same location as the .bat file;
2.Save the following file as bat file to c:\jobs;




for /f "usebackq tokens=*" %%T in ("FolderList.txt") do (
robocopy c:\temp\myfiles_src\ \\mydestination\%%T\myfolder\ /s /LOG+:C:\jobs\log\%date:~-4,4%%date:~-10,2%%date:~-7,2%_log.txt 
)



Execute this bat file manually or through a scheduled job.

Advertisements


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s