JeffBeall
asked on
robocopy
At work they disabled offline folders, so i thought i would make a simple batch file and put it in the startup folder, and try to find a way to have it run when i log off.
so far i have this in my batch file
cd \
robocopy /MIR /fft /XO "H:\Computer stuff" C:\syncfolders\compstuff
robocopy /MIR /fft /XO H:\MyDocs C:\syncfolders\mydocs
pause
I started with the first robocopy line, and it worked fine. so i added the second line, and now it only runs the second line.
is there a way to have it run the first line, then the second line? eventually i will have about 5 robocopy lines for the different folders i want to "sync"
By the way, i have the pause there to make sure it works, once it's running fine, i will take it out.
so far i have this in my batch file
cd \
robocopy /MIR /fft /XO "H:\Computer stuff" C:\syncfolders\compstuff
robocopy /MIR /fft /XO H:\MyDocs C:\syncfolders\mydocs
pause
I started with the first robocopy line, and it worked fine. so i added the second line, and now it only runs the second line.
is there a way to have it run the first line, then the second line? eventually i will have about 5 robocopy lines for the different folders i want to "sync"
By the way, i have the pause there to make sure it works, once it's running fine, i will take it out.
ASKER
I agree, I really like the offline files,
to answer your question,
It seems like it isn't running each line in sequence because it shows the copy statistics, and for the first line there is about 200 files copied, and for the second line there is only 22 files. in the statistics, after running it the first time, it showed that 200 files were skipped, which is good because there was no change to these files. then when i added the second line, and ran it a second time, it shows only 20 files are skipped.
So as a test I made a change to a file that would be located in the first robocopy line. but when i run the batch file, it still shows nothing copied and 22 files skipped.
as far as calling the batch file, no, all i have is
cd \
robocopy /MIR /fft /XO "H:\Computer stuff" C:\syncfolders\compstuff
robocopy /MIR /fft /XO H:\MyDocs C:\syncfolders\mydocs
pause
to answer your question,
It seems like it isn't running each line in sequence because it shows the copy statistics, and for the first line there is about 200 files copied, and for the second line there is only 22 files. in the statistics, after running it the first time, it showed that 200 files were skipped, which is good because there was no change to these files. then when i added the second line, and ran it a second time, it shows only 20 files are skipped.
So as a test I made a change to a file that would be located in the first robocopy line. but when i run the batch file, it still shows nothing copied and 22 files skipped.
as far as calling the batch file, no, all i have is
cd \
robocopy /MIR /fft /XO "H:\Computer stuff" C:\syncfolders\compstuff
robocopy /MIR /fft /XO H:\MyDocs C:\syncfolders\mydocs
pause
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
thank you for the help
No problem, did you get it working then or the log throw anything up?
Steve
Steve
ASKER
sorry it's been such a slow responce, I ended up re-doing the batch file.
I think the most significant difference on the new batch file was putting quotes around all the paths in each robocopy statements, and adding the /fft switch. So it looks like this now.
cd \
robocopy /MIR /fft /XO "H:\Computer stuff" "C:\syncfolders\compstuff"
robocopy /MIR /fft /XO "H:\MyDocs" "C:\syncfolders\mydocs"
robocopy /MIR /fft /XO "H:\MyDocuments" "C:\mydocuments"
robocopy /MIR /fft /XO "H:\Printer Stuff" "C:\printerstuff"
It seems to be working now. Thank you again for all your help.
I think the most significant difference on the new batch file was putting quotes around all the paths in each robocopy statements, and adding the /fft switch. So it looks like this now.
cd \
robocopy /MIR /fft /XO "H:\Computer stuff" "C:\syncfolders\compstuff"
robocopy /MIR /fft /XO "H:\MyDocs" "C:\syncfolders\mydocs"
robocopy /MIR /fft /XO "H:\MyDocuments" "C:\mydocuments"
robocopy /MIR /fft /XO "H:\Printer Stuff" "C:\printerstuff"
It seems to be working now. Thank you again for all your help.
Anyway back to your q, not quite sure what you mean about running one line then the next, it will do that anyway? You haven't called the batch file robocopy.cmd have you so the next robocpy command calls the batch file again?
Steve