Here's the broken batch file:
@echo off
if prod==prod (
if xps==xps (
set i1=prodxpsi1
set i2=prodxpsi2
set e1=prodxpse1
set e2=prodxpse2
) else (
set i1=prodzpsi1
set i2=prodzpsi2
set e1=prodzpse1
set e2=prodzpse2
)
if 1==1 (
echo %i1%, %i2%, %e1%, %e2%
) else (
echo %i1%, %i2%, %e1%, %e2%
)
)
pause
However, when I take out the outer if prod==prod block like this, it works:
@echo off
if xps==xps (
set i1=prodxpsi1
set i2=prodxpsi2
set e1=prodxpse1
set e2=prodxpse2
) else (
set i1=prodzpsi1
set i2=prodzpsi2
set e1=prodzpse1
set e2=prodzpse2
)
if 1==1 (
echo %i1%, %i2%, %e1%, %e2%
) else (
echo %i1%, %i2%, %e1%, %e2%
)
pause
This is a job for SuperUser!
Update: See below:

When I run the batch file the first time, it echoes , , ,. When I run it the second time, it works fine. I will look into this more tomorrow.