Home Forums SQL Server 2005 Backups Using Robocopy within SQL Agent job - headache with error codes! RE: Using Robocopy within SQL Agent job - headache with error codes!

  • I'm having the exact same issue!

    My problem is that I've got round the exit code issue by this:

    ROBOCOPY D:\filetocopy E:\filetocopyto ^& IF %ERRORLEVEL% LEQ 1 exit 0 /MAXAGE:1

    The problem which I'm having now is that the '/MAXAGE:1' part of the syntax is being ignored when ran, this is important part of the syntax for me but I also need Robocopy to exit with a code 0 when successful! What am I missing?