标题: [文本处理] 批处理如何解析ini格式? [打印本页]
作者: wajika 时间: 2021-3-12 15:52 标题: 批处理如何解析ini格式?
本帖最后由 wajika 于 2021-3-12 15:53 编辑
这个ini (https://osce14-p.activeupdate.trendmicro.com/activeupdate/server.ini ),解析出两个key
[PATTERN]
P.2=pattern/vsapi589.zip
和
[Server]
Https=https://osce14-p.activeupdate.trendmicro.com/activeupdate
最后拼接出这样的效果
https://osce14-p.activeupdate.trendmicro.com/activeupdate/pattern/vsapi589.zip
有没有大佬教下如何解析ini?
作者: went 时间: 2021-3-12 17:02
- @echo off & cd /d "%~dp0"
- set "url=https://osce14-p.activeupdate.trendmicro.com/activeupdate/server.ini"
- certutil -urlcache -split -f "%url%" "_tmp.data" | findstr "0x" && (echo download file failed. & pause&exit)
- for /f "tokens=1,2 delims==," %%i in ('type "_tmp.data" ^| findstr /C:"P.2=" /C:"Https="') do set "%%i=%%j"
- del /f "_tmp.data"
- echo %Https%/%P.2%
- pause&exit
复制代码
作者: wajika 时间: 2021-3-13 09:14
回复 2# went
感谢 成功了
欢迎光临 批处理之家 (http://www.bathome.net/) |
Powered by Discuz! 7.2 |