Skip to content

Instantly share code, notes, and snippets.

@house9
Created June 2, 2011 00:10
Show Gist options
  • Save house9/1003646 to your computer and use it in GitHub Desktop.
Save house9/1003646 to your computer and use it in GitHub Desktop.
robocopy_fix.bat
rem http://weblogs.sqlteam.com/robv/archive/2010/02/17/61106.aspx
robocopy %*
rem suppress successful robocopy exit statuses, only report genuine errors (bitmask 16 and 8 settings)
set/A errlev="%ERRORLEVEL% & 24"
rem exit batch file with errorlevel so SQL job can succeed or fail appropriately
exit/B %errlev%
rem USAGE: just like regular robocopy
robocopy_fix.bat C:\temp\s C:\temp\d /MIR
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment