I have a batch that copies some files on the network, this copy updates the previous files to the newest cases if they already exist in the destination folder, but if any files are in use the system does not display the error message in the end just the moment you are trying to update the file.
At the moment I do not want to solve this problem of the file 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 the condition if "%errorlevel%"=="0"
at the end but this condition does not work if there were errors in the middle of the copy.
Follow my command:
xcopy "C:\Origem\." "C:\Destino\" /c /d /e /h /i /k /r /y