Batch file version of "on error resume nest"
Posted on 2011-03-24
I have a batch file to copy logs from single servers to a shared loaction. It seems that if any of the files in the source directory are locked or in use the whole batch file command set fails and issues and exit code of 4. Is ther a line to add to tell the commands if there is an error with any of the files to copy to just move on to the next. Batch file is as follows.
set dir=%date:/=-% %T::=-%
echo The target folder is "%dir%".
xcopy /L "D:\GCTI\Logs\*.*" > "\\usmoksc5app55\text\usmoksc5app27\%dir%\%date:/=-% %T::=%.log"
xcopy /s /c /y "D:\GCTI\Logs\ksc_sip_pri\Archive\*.*" "\\usmoksc5app55\logs\usmoksc5app27\%dir%\"