Problem in creating a batch file for windows

0

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?

    
asked by anonymous 16.02.2018 / 12:21

0 answers