When I use this piece of code, it works normally:
@echo off
setlocal enableDelayedExpansion
if exist 1 == 1 (
set /p CONFIRM="Previous version is installed! Continue?"
)
if exist 2 == 2 (
set /p CONFIRM="Previous version is installed! Continue?"
echo {!CONFIRM!}
)
Endlocal
But when I insert an if after the set the prompt starts saying the syntax is wrong:
@echo off
setlocal enableDelayedExpansion
if exist 1 == 1 (
set /p CONFIRM="Previous version is installed! Continue?"
if !CONFIRM! == 1(
ECHO ENTROU
)
)
if exist 2 == 2 (
set /p CONFIRM="Previous version is installed! Continue?"
echo {!CONFIRM!}
)
Endlocal
Does anyone have any light to solve this problem?