The following script is working properly, you can test both results. You first need to open the command window and then execute the script. I added the /b again so the command window won't close after execution.
The script below is tested by copying a file. When c:\temp\test.txt exists and can be copied, you will see that both if %errorlevel% lines visible in the command window. This means that the first if was false and the second did execute the exit. When c:\temp\test.txt doesn't exist you will see only the first if and falls true. This means that the script works effectively with the copy process. Hopefully it will work just as well with your command.
copy "c:\temp\test.txt" copy.txt
rem swap the result code so that no matches = 0, to suit MSBuild conventions
if %errorlevel%==1 EXIT /b 0
if %errorlevel%==0 EXIT /b 1
Good luck!