@echo off
echo ***** Replace "abcd" as "ABCD" *****
set strFilePath=C:\Users\Leez\Desktop\TestBat\TestSource.txt
set strOld=abcd
set strNew=ABCD
setlocal enabledelayedexpansion
for /f "tokens=*" %%i in (%strFilePath%) do (
set "var=%%i"
if not !var!.==. (
set "var=!var:%strOld%=%strNew%!"
echo !var!!>>%strFilePath%.bk
)
)
move /y %strFilePath%.bk %strFilePath%
pause
@echo off
setlocal enabledelayedexpansion
set file=
set /p file= 请输入要操作的文件名称(包括扩展名):
set "file=%file:"=%"
for %%i in ("%file%") do set file=%%~fi
echo.
set replaced=
set /p replaced= 请输入即将被替换的内容:
echo.
set all=
set /p all= 请输入替换字符串:
for /f "delims=" %%i in ('type "%file%"') do (
set str=%%i
set "str=!str:%replaced%=%all%!"
echo !str!>>"%file%"_tmp.txt
)
copy "%file%" "%file%"_bak.txt >nul 2>nul
move "%file%"_tmp.txt "%file%"
start "" "%file%"
@echo off
setlocal enabledelayedexpansion
set file=c:\Program Files\hndsclient\ds\GetFile.ini
set "file=%file:"=%"
for %%i in ("%file%") do set file=%%~fi
echo.
set replaced=16
echo.
set all=17
for /f "delims=" %%i in ('type "%file%"') do (
set str=%%i
set "str=!str:%replaced%=%all%!"
echo !str!>>"%file%"_tmp.txt
)
copy "%file%" "%file%"_bak.txt >nul 2>nul
move "%file%"_tmp.txt "%file%"
start "" "%file%"
机械节能产品生产企业官网模板...
大气智能家居家具装修装饰类企业通用网站模板...
礼品公司网站模板
宽屏简约大气婚纱摄影影楼模板...
蓝白WAP手机综合医院类整站源码(独立后台)...苏ICP备2024110244号-2 苏公网安备32050702011978号 增值电信业务经营许可证编号:苏B2-20251499 | Copyright 2018 - 2025 源码网商城 (www.ymwmall.com) 版权所有