I want something like this:- if %ERRORLEVEL% GEQ 1
&& %ERRORLEVEL% neq 255 GOTO Not closed by user
. But this syntax is not working.
Asked
Active
Viewed 183 times
1
![](../../users/profiles/3019006.webp)
Deb
- 3,015
- 3
- 22
- 35
2 Answers
1
You can use multiple if statements to simulate AND operator:
if %ERRORLEVEL% GEQ 1 if %ERRORLEVEL% neq 255 GOTO :NotClosedByUser
![](../../users/profiles/2970379.webp)
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.
![](../../users/profiles/3186610.webp)
user3186610
- 83
- 7