I'm using a batch script to copy a backup of my local files to a shared drive on another computer in my network. I'm having a problem with Xcopy's error codes. @echo off ::::::::::::::::::::::::::::::: ::::Script Global Variables:::: ::::::::::::::::::::::::::::::: SET localDir=C:\temp\ SET destDir=\\Autumn\documents\daniel\backup\ SET base=%computername% SET backupName=%base%%date:~-4,4%%date:~-10,2% ::SET suffix=%date:~-4,4%%date:~-10,2% SET errorLog=backup.log SET numArchives=2 ::::::::::::::::::::::::::::::::::::::: ::: Do not modify beyond this point:::: ::::::::::::::::::::::::::::::::::::::: echo Running system backup echo. echo System backup started %date:~-10,10% %time:~0,8%>>%errorLog% ::--Always local update & copy-- (Current version):: echo Checking for existing backup... xcopy %destDir%%backupName%.rar %localDir% /y 2>>%errorLog% if errorlevel 4 ( if not exist %destDir% ( echo Error: Destination folder not found >> %errorLog% goto error ) echo None found. New file will be created. ) echo Backing up local files... "C:\Program Files\winrar\winrar" u -as -os -ep3 -r -t -ilog%errorLog%.winrar.log -inul -x@backup_excl.lst %localDir%%backupName% @backup.lst echo Done. echo Copying backup to remote folder... xcopy %localDir%%backupName%.rar %destDir% /y 2>>%errorLog% del %localDir%%backupName%.rar 2>>%errorLog% FOR /f "skip=%numArchives% delims=" %%I IN ('DIR %destDir%%base%*.rar /A-D /B /O-D') DO del "%destDir%%%I" 2>>%errorLog% echo Backup complete goto error2 :error echo Backup stopped unexpectedly! >> %errorLog% echo Backup stopped unexpectedly! See error log for details. PAUSE :error2 echo System backup finished %date:~-10,10% %time:~0,8%>>%errorLog% echo.>>%errorLog% :: WinRAR <command> -<switch1> -<switchN> <archive> <files...> <@listfiles...> <path_to_extract\> :: Winrar switches: :: -ac handle "archive" file attributes :: -as synchronize (delete files from archive) :: -ep3 expand paths to full (including drive letter) :: -ilog error log location :: -inul disable error messages :: -n include files/lists :: -os important for NTFS file system backups :: -r recurse subfolders :: -u update files (same as 'u' command) :: -t test files after archiving :: -x exclude files/lists