【发布时间】:2022-01-03 20:35:51
【问题描述】:
有一个名为“Settings.txt”的文件,该文件包含很多行,包括以下变量行:
X 100
这一行的数字是可变部分,“X”是固定文本。
我需要检查该数字是否为 (小于 100) OR (等于或大于 100) 然后基于结果 > 转到 A 或 B。
脚本可能是这样的:
IF >> "X 100" in "D:\Settings.txt" GEQ 100 goto A else goto B
:A
@echo the value is equal or greater than 100
pause & goto continue
:B
@echo the value is less than 100
pause
:continue
#the rest of the script
【问题讨论】:
标签: windows batch-file cmd