Windows批处理命令忽略变量大小写 [英] Windows batch command to ignore case sensitivity in variables

查看:831
本文介绍了Windows批处理命令忽略变量大小写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一组变量我让一些人与我共事进行编辑。这些都是真的( T )和假(˚F)的值,但我有一些人坚持把 T ˚F而不是大写的值。

I have a set of variables I allow some people I work with to edit. These are True (T) and False (F) values, but I have some people that insist on putting t and f instead of the upper case values respectively.

我用以下解决方法code正确设置大写的值:

I use the following workaround code to properly set uppercase values:

IF '%dotnet35%'=='f' set dotnet35=F
IF '%dotnet35%'=='t' set dotnet35=T
IF '%dotnet40%'=='f' set dotnet40=F
IF '%dotnet40%'=='t' set dotnet40=T
IF '%regedit%'=='f' set regedit=F
IF '%regedit%'=='t' set regedit=T
IF '%SSL%'=='f' set SSL=F
IF '%SSL%'=='t' set SSL=T

这是但十分笨重,而且它不容易对眼睛...有没有这样做,而无需使用VBS或任何其他编程语言的任何其他方式?

This is however extremely bulky and it's not easy on the eyes... is there any other way of doing this without using VBS or any other programming language?

推荐答案

帮助,如果 / I开关,如果指定,说做不区分大小写串
相比较。 / I开关也可以对字符串1使用==字符串2形式
IF的。

和尝试 IF / I%SSL%== F的

这篇关于Windows批处理命令忽略变量大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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