The IF statement has an ELSE clause, but no OR clause.
You can emulate an OR using either of the following methods:
set OK=N FOR /F "Tokens=*" %%I in ('@echo \[%userName%\]^|Findstr /i "\[Jennifer\] \[Richard\] \[Jerry\] \[Alisa\]"') DO ( set OK=Y ) if "%OK%" EQU "Y" @echo Found.
OK=N FOR %%I IN (\[Jennifer\],\[Richard\],\[Jerry\],\[Alisa\]) DO ( if /i \[%USERNAME%\]%%I ( set OK=Y ) ) if "%OK%" EQU "Y" @echo Found.
NOTE: The separator can be any legal character, like ":
OK=N FOR %%I IN ("Jennifer","Richard","Jerry","Alisa") DO ( if /i "%USERNAME%" %%I ( set OK=Y ) ) if "%OK%" EQU "Y" @echo Found.
0 comments
Hide comments