I have written a Vim plugin which shells out to run external commands. Two of the commands I run are diff and grep which can each exit with a non-z
diff
grep
cd .
also sets %ERRORLEVEL% to 0 but runs a bit faster and writes a bit shorter than ver>nul. Example:
%ERRORLEVEL%
ver>nul
mkdir . 2>nul || cd .