So I just got a new job as an IT – Assistant, I am incharge of maintaing some backups for this office. They were using the following robo copy commands to backup all the My Documents on all the systems in the office (about 80 machines in all). I can’t for the life of me figure out what this loop is doing…
for /D %%f in (*) do c:\batch\Scheduled\Robocopy "\\%%f\c$\my documents" "G:\Eureka\MyDocBack\%%f" /XD Laptops /XF *.m4a *.mp3 *.wma *.rmx /E /R:1 /W:1 /Log+:G:\Eureka\RoboLogs\%%f_Log.log /NP /TEE
It looks like the computer names come directly from the folder names that are found in G:\Eureka\MyDocBack.
The 'For' part is basically saying for each directory in the current folder (G:\Eureka\MyDocBack) - do this. %%f represents the folder name, which gets passed into the robocopy options as a computer name.
The rest looks hard coded for the computer called kpryor and viper so that isn't going to do anything different regardless of how the folders change.
To add a new computer to back up I would just make a folder for it. i.e. G:\Eureka\MyDocBack\Harri1010