Galop said:
I need a command line syntax for multiple OR operations in a single IF
command. As below:
IF A=2 OR 3 OR 7 OR 11 OR 12
SET HHMM=GROUP1
GOTO %HHMM%:
- - - - - - begin screen capture WinXP SP2 - - - - - -
C:\cmd>demo\MultipleOR 12
The value of A - 12 - is one of the following: 2 3 7 11 12
C:\cmd>demo\MultipleOR ab
The value of A - ab - is *not* one of the following: 2 3 7 11 12
C:\cmd>demo\MultipleOR 3
The value of A - 3 - is one of the following: 2 3 7 11 12
C:\cmd>demo\MultipleOR 3.3.
The value of A - 3.3. - is *not* one of the following: 2 3 7 11 12
C:\cmd>demo\MultipleOR 7
The value of A - 7 - is one of the following: 2 3 7 11 12
C:\cmd>wyllist demo\MultipleOR.cmd
==========begin file C:\cmd\demo\MultipleOR.cmd ==========
001. @echo off
002. setlocal
003. set A=%1
004. echo/.2.3.7.11.12. | findstr /c:".%A%." > nul
005. if %errorlevel% equ 0 (
006. echo/The value of A - %A% - is one of the^
007. following: 2 3 7 11 12
008. ) else (
009. echo/The value of A - %A% - is *not* one of^
010. the following: 2 3 7 11 12
011. )
==========end file C:\cmd\demo\MultipleOR.cmd ==========
- - - - - - end screen capture WinXP SP2 - - - - - -