SET var1="Hello World"
SET var2="Hello World"
if %var1% == %var2% echo This will work, because value is quoted
#If you can't or don't want to quote values
SET var1=Hello World
SET var2=Hello World
if "%var1%" == "%var2%" echo This will work, because variable is quoted