1
@echo off
cls
echo My own logic thinks an IF OR STATEMENT should work this way..
IF [1]==[1] echo good
IF [2]==[2] echo times
IF [1]==[2] echo this actually should not output
IF [1]==[1] OR [2]==[2] echo hello there (with or)
REM it told me 'or' is not recognized as an internal or external command, operable program or batch file.  

I haven't figured out the problem with the syntax of OR

1 Answers1

1

there's no OR condition in batch files.You need to create your own:

IF [1]==[1] (
  echo ok
) else (
  if [2]==[2] (
     echo ok
  ) else (
     echo not ok
  )
)
npocmaka
  • 55,367
  • 18
  • 148
  • 187
  • 1
    +1 http://social.technet.microsoft.com/Forums/scriptcenter/en-US/44537d53-34d2-4c38-b268-94fbbc549429/how-to-use-logical-or-operator-in-batch-script?forum=ITCG – kenny Sep 08 '14 at 23:09