I always get jenkins failure:
Build step 'Execute Windows batch command' marked build as failure
but when I put in batch command: "echo Exit Code is %errorlevel%" I get 0 code.
My batch command is:
ELSE (
ROBOCOPY.EXE C:\dir2\ C:\dir1\ script.bat /IS
cd C:\dir1\
echo Exit Code is %errorlevel%
C:\dir1\script.bat
echo Exit Code is %errorlevel%
ROBOCOPY.EXE C:\dir1 C:\dir3 /E /IS /XF *.config
echo Exit Code is %errorlevel%
)
echo TEST
Command echo TEST is never shown. When I delete from batch "C:\dir1\script.bat" everything works fine and jenkins job is success.
Script bat contains only commands like:
del .\bin\library.dll
What do you think, the problem is with script.bat? When I add in the end of this script: EXIT /B 0 , the job is also failed.