cmd.exe: complex conditions?

后端 未结 6 830
没有蜡笔的小新
没有蜡笔的小新 2021-01-08 01:25

in DOS batch files, In an IF statement, is it possible to combine two or more conditions using AND or OR ? I was not able to find any documentation for that

6条回答
  •  暖寄归人
    2021-01-08 01:51

    AND:

    IF  IF  ACTION
    

    OR:

    (SET _=) & (IF  (SET _= ) ELSE IF  (SET _= )) & IF DEFINED _ ACTION
    

    For implementing OR this way, you do need command extensions.

提交回复
热议问题