I have the one batch that does the copy of some files in the network, this copy updates the previous files by the newest case they already exist in the destination folder, however if any file is in use the system does not present the error message at the end only in the Moment you are trying to update the file.
At the moment I do not want to solve this file problem being in use, I would only like the command to report only at the end of the copy if there was an error in updating some file.
I put in the end the condition if "%errorlevel%" == "0"
but this condition does not work if there were errors in the middle of the copy.
My command:
xcopy "C:\origin\." "C:\destination\" /c /d /e /h /i /k /r /y