1

I want something like this:- if %ERRORLEVEL% GEQ 1 && %ERRORLEVEL% neq 255 GOTO Not closed by user . But this syntax is not working.

Deb
  • 3,015
  • 3
  • 22
  • 35

2 Answers2

1

You can use multiple if statements to simulate AND operator:

if %ERRORLEVEL% GEQ 1 if %ERRORLEVEL% neq 255 GOTO :NotClosedByUser
mihai_mandis
  • 1,488
  • 1
  • 9
  • 12
0

I guess you can also do it like this :

if %ERRORLEVEL% GEQ 1 (
if %ERRORLEVEL% neq 255 (
GOTO NotClosedByUser
)
)

So this can be easier to read, I think.