The spaces in the set
command are important, and included both in the value and in the name of the variable.
....
.... set "vars=%%i"
if
operators will only work if the left and the right operands follow the same rules. If you quote one value, quote also the other. If not, one value will have quotes, the other not and condition will always evalueate to false
if "%vars%"=="0"
if %vars%==0
if "%vars%" equ "0"
if %vars% equ 0