I am using the RD command in my batch script to remove a directory.
I assumed RD should return 0 for success, or 1 for failure. but it doesn't appear to do so.
I am using the Robocopy command utility before the RD command, and its taking the Errorlevel from Robocopy instead.
Please advise the exact exit codes RD returns for success and failure.
robocopy src target ...
rd /S /Q %Target%
IF %ERRORLEVEL% EQU 0 goto :good
IF %ERRORLEVEL% NEQ 0 goto :fail
Your assumption is incorrect.