1. 数字和字符串的比较
if 1 LSS 2 echo "1 les 2"
if "1.0.2" == "1.0.2" echo 1.0.2 equal 1.0.2
if not "1.0.3" == "1.0.2" echo 1.0.2 not equal 1.0.3
if "1.0.3" GTR "1.0.2" echo "1.0.3" GTR "1.0.2"
if "1.0.3" LSS "1.0.2" echo "1.0.3" LSS "1.0.2"
检查python是否安装,检查必须模块是否安装
2. 检查python是否安装
https://blog.csdn.net/mlz_2/article/details/123924916
3.参考文章或者资料
BAT批处理文件 if命令详解
1.IF的第一种用法,比较字符串
2.IF的第二种用法,比较数字
3.IF的第三种用法,检测文件(夹)是否存在
4.IF的第四种用法,检测变量是否被定义
5.IF的第五种用法,判断返回值(ERRORLEVEL)
一个从字符中提取数字的bat
@echo off
rem 从一行字符串/一句话中提取出数字
set #=Any question
set @=WX
set $=Q
set /az=0x53b7e0b4
title %#% +%$%%$%/%@% %z%
set "line=1.22.23"
>"%tmp%\j.j" echo;var m=WSH.Arguments(0).match(/\d+/g);WSH.echo(m.join('\r\n'))
for /f "delims= " %%a in ('cscript -nologo -e:jscript "%tmp%\j.j" "%line%"') do (
echo;%%a
)
echo;%#% +%$%%$%/%@% %z%
pause