John D让原始的not运算符可用于批量编程.
if not a==b echo ok
Run Code Online (Sandbox Code Playgroud)
使用HELP IF查看通过命令扩展引入的所有可用运算符
If Command Extensions are enabled IF changes as follows:
IF [/I] string1 compare-op string2 command
IF CMDEXTVERSION number command
IF DEFINED variable command
where compare-op may be one of:
EQU - equal
NEQ - not equal
LSS - less than
LEQ - less than or equal
GTR - greater than
GEQ - greater than or equal
Run Code Online (Sandbox Code Playgroud)
所以一个不相等的条件可以写成
if a neq b echo ok
Run Code Online (Sandbox Code Playgroud)