setlocal enabledelayedexpansion
:: ---------------- 获取换行符 0A ---------------------
set NLM=^
set NL=^^^%NLM%%NLM%^%NLM%%NLM%
:: ---------------- /获取换行符 0A ---------------------
set file=.\local.prop
::set /p file=.\local.prop
set "file=%file:"=%"
for %%i in ("%file%") do set file=%%~fi
set replaced=“ro.config.xxx=true”
::set /p replaced=“ro.config.xxx=true”
set all=“ro.config.beta_sec_ctrl=false”
::set /p all=“ro.config.beta_sec_ctrl=false”
for /f "delims=" %%i in ('type "%file%"') do (
set str=%%i
set "str=!str:%replaced%=%all%!"
set /p=!str!%NL%<nul >>"%file%"_tmp.txt
)
copy "%file%" "%file%"_bak.txt >nul 2>nul
move "%file%"_tmp.txt "%file%"
start "" "%file%"
pause
:: ---------------- 获取换行符 0A ---------------------
set NLM=^
set NL=^^^%NLM%%NLM%^%NLM%%NLM%
:: ---------------- /获取换行符 0A ---------------------
set file=.\local.prop
::set /p file=.\local.prop
set "file=%file:"=%"
for %%i in ("%file%") do set file=%%~fi
set replaced=“ro.config.xxx=true”
::set /p replaced=“ro.config.xxx=true”
set all=“ro.config.beta_sec_ctrl=false”
::set /p all=“ro.config.beta_sec_ctrl=false”
for /f "delims=" %%i in ('type "%file%"') do (
set str=%%i
set "str=!str:%replaced%=%all%!"
set /p=!str!%NL%<nul >>"%file%"_tmp.txt
)
copy "%file%" "%file%"_bak.txt >nul 2>nul
move "%file%"_tmp.txt "%file%"
start "" "%file%"
pause