I am getting a weird error in my batch program. I think the problem is in enable delayed expansion, but the fix I apply doesn't work. This is my code:
setlocal ENABLEDELAYEDEXPANSION
for /l %%x in (1, 1, 3) do (
set ff=Firefox_45_0.0_%%x
echo %%x
firefox.exe -CreateProfile "%ff% %homedrive%%homepath%\Desktop\Firefoxes\Profiles\Firefox_45_0.0_%%x"
)
ff doesn't have any value, although I used delayed expansion. What could be the fix?
EDIT: command printed to console (I don't use @echo off)
C:\Users\Home2\Desktop\Firefoxes\Versions\Firefox_45_0.0>(
set ff=Firefox_45_0.0_1
echo 1
firefox.exe -CreateProfile "!ff! C:\Users\Home2\Desktop\Firefoxes\Profiles\Firefox_45_0.0_1"
)
What is funny is that it actually performs as expected, although it prints !ff! in the console.