批处理把字符串插入到xml指定位置
2023-9-17 乱云飞
@echo off setlocal enabledelayedexpansion set "inputFile=config.ini" set "outputFile=onvif.ini" set "insertString=rtsp://127.0.0.1:8554/screenlive+audiodevice" set "targetStartTag=<stream_uri>" set "targetEndTag=</stream_uri>" set "insertLine=%targetStartTag%%insertString%%targetEndTag%" ( for /f "delims=" %%I in ('type "%inputFile%" ^& echo/') do ( set "line=%%I" if "!line!"=="!line:%targetStartTag%=%!" ( echo %%I ) else ( echo !insertLine! ) ) ) > "%outputFile%" echo Done!本文链接:http://80c.cc/ez/699.html
发表评论: