替换一个文件的字符串
::将sourcefile中的字段true替换为xxx ::该文件放在网管安装路径的根目录下即可 @echo off setlocal enabledelayedexpansion set dir=%CD% set sourcefile=%dir%\...\mw-license-switch-conffile.xml set targetfile=%dir%\...\mw-license-switch-conffile1.xml for /f "delims=" %%i in ('type "%sourcefile%"') do ( set str=%%i set str=!str:true=charTobeModify! echo !str!>>"%targetfile%" ) del "%sourcefile%" ren "%targetfile%" mw-license-switch-conffile.xml