Batch file 批处理中的“非”登录是什么
在批处理中,表示如果%stackoverflow%==某个东西,则==表示等于 什么不是这个版本 我试过了!=但是,这只会抛出一个错误,并且不知道是否有not命令。如何:Batch file 批处理中的“非”登录是什么,batch-file,Batch File,在批处理中,表示如果%stackoverflow%==某个东西,则==表示等于 什么不是这个版本 我试过了!=但是,这只会抛出一个错误,并且不知道是否有not命令。如何: if not %stackoverflow%==something 如果要执行不区分大小写的比较添加/i: if /i not %stackoverflow%==something John D使原始的not运算符可用于批处理编程 if not a==b echo ok 如果要查看命令扩展引入的所有可用运算符,请使用“帮
if not %stackoverflow%==something
如果要执行不区分大小写的比较添加/i:
if /i not %stackoverflow%==something
John D使原始的not运算符可用于批处理编程
if not a==b echo ok
如果要查看命令扩展引入的所有可用运算符,请使用“帮助”
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
所以一个不相等的条件可以写成
if a neq b echo ok
我不知道你可以使用,如果没有,但这应该工作!谢谢你澄清这一点,这对澄清第一个答案的错误和新答案都有很大帮助!