By default, any non-zero exit code throws an exception. If a program returns a non-zero code for a successful operation (e.g., Robocopy), you can suppress the exception by providing a delegate to the handleExitCode parameter.
Return true from the delegate to indicate the exit code has been handled (suppressing the exception), or false to allow the default exception behavior.
// Suppress exception for Robocopy if exit code is less than 8
Run("ROBOCOPY", "from to", handleExitCode: code => code < 8);
// Capture the exit code while suppressing the exception
var exitCode = 0;
Run("ROBOCOPY", "from to", handleExitCode: code => (exitCode = code) < 8);
// Use the captured exit code
var oneOrMoreFilesCopied = exitCode & 1;