本帖最后由 WHY 于 2019-8-5 20:41 编辑
- @echo off
- set /p input=input:
- (for /f "delims=" %%i in (a.xml) do (
- set "str=%%i"
- setlocal enabledelayedexpansion
- if "!str:<ComputerName>=!" NEQ "!str!" (
- echo; ^<ComputerName^>PCZF!input!^</ComputerName^>
- ) else (echo;!str!)
- endlocal
- )) > b.xml
- move b.xml a.xml
- pause
复制代码
|