Il tuo if contiene un underscore x la variabile o cmq prova, dopo che termini il batch, le tue variabili settate.