Getting ROBOCOPY to return a "proper" exit code?
- by Lasse V. Karlsen
Is it possible to ask ROBOCOPY to exit with an exit code that indicates success or failure?
I am using ROBOCOPY as part of my TeamCity build configurations, and having to add a step to just silence the exit code from ROBOCOPY seems silly to me.
Basically, I have added this:
EXIT /B 0
to the script that is being run.
However, this of course masks any real problems that ROBOCOPY would return.
Basically, I would like to have exit codes of 0 for SUCCESS and non-zero for FAILURE instead of the bit-mask that ROBOCOPY returns now.
Or, if I can't have that, is there a simple sequence of batch commands that would translate the bit-mask of ROBOCOPY to a similar value?