Robocopy Exit Codes: 0 and 1 usually mean success
Posted by jpluimers on 2012/10/08
Most console applications return 0 (zero) as success.
But sometimes there are multiple success result codes, and the success depends on what you want to do with them.
One example is RoboCopy.
The zero result code means that nothing happened: no error occurred and nothing was copied, because there was no need to.
But for most RoboCopy scenario’s result code 1 (one) is also success. It means that no error occurred and that one ore more files were copied.
In fact the RoboCopy result codes form a bitmap explained on ss64.com.
Most RoboCopy use cases will have [0,1] as the set off success result codes.
–jeroen
via: Robocopy Exit Codes.
David Gray said
According to various Web pages, including the official documentation on TechNet, exit code zero means that nothing happened. I can prove that this is unequivocally FALSE. Copying a new file yields an exit code of ZERO.
jpluimers said
Please prove that with some links to the relevant documentation. Thanks in advance.
–jeroen
The Robocopy exit code and MSBuild postbuild error problem | Becoming a .net Ninja said
[…] recent blog post of my friend Jeroen Pluimers about “Robocopy exit codes 0 and 1 usually mean success” reminded me of a problem I had with this fact a few years […]