有没有办法这样说
if %1 == 1 or %1 == 2
在批处理文件中?或者,如果我可以指定一组候选值,例如
if %1 in [1, 2, 3, 4, ... 20]
最佳答案
事实证明“and”很简单——只是不是您期望的语法: 这 3 个例子说明了这一点。
换句话说:If 1==1 AND 2==2 then echo "hello"
if 1==1 echo hello
hello
if 1==1 if 2==2 echo hello
hello
if 1==1 if 2==1 echo hello
(nothing was echoed)
关于windows-xp - Windows批处理文件: multiple if conditions,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6060046/