什么是批次中的"不"标志

Gar*_*nes 0 batch-file

在批,说if %stackoverflow%==something==手段等于

什么是"非"版本?

我试过"!="然而只会抛出一个错误,并且真的不知道是否有"不"命令.

dbe*_*ham 5

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)