When using command line version of sudo from batch file, sudo:
- does not wait until called process terminates
- does not returns called process exit code ("errorlevel") to batch
Example:
...
sudo "C:\Program Files\WinRAR\rar.exe" a ...(other params)
set RE=%ERRORLEVEL%
if %RE% GTR 0 ....but there is not rar.exe exit code