if语句中的批处理通配符 [英] Batch wildcards in if statement

查看:624
本文介绍了if语句中的批处理通配符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一开始就这么说,所以不会发生这样的事情:不要因为某种原因而对批次说不好。



我需要通配符if语句类似



Im saying this at the beginning so it doesn't happen: Don't say anything bad about batch its needed for a reason.

I need wildcards in an if statement something like

<br />
if "food is good"=="food * good" echo Yes I agree it is<br />



              &NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;&NBSP;         (通配符)





这可能吗?我怎么能这样做?


                                              (Wildcard)


Is this possible? How can I do this?

推荐答案

AFAIK批处理IF语句仅适用于字符串相等/不相等,没有通配符。

但是,编写一个以两个字符串作为参数的quick'n'dirty应用程序并不困难,并且返回ERRORLEVEL 0表示相等,+1表示-1表示更大且小于。既然它是你的应用程序,那么通配符将完全由你控制......
AFAIK the batch IF Statement only works on string equality / non-equality, there are no wildcards.
However, it would not be difficult to write a quick'n'dirty application which takes two strings as parameters, and returns ERRORLEVEL 0 for equality and +1 and -1 for greater and less than. Since it'd be your app, wildcards would be completely under your control...


这篇关于if语句中的批处理通配符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆