Emy 当前离线
列兵
@echo off set "str1=26" set "str2=28" Setlocal Enabledelayedexpansion for /r "D:\A-相关无用文件备份\20231226\- 模板备份1228" %%j in (*) do ( for /f "delims=" %%i in ('dir /b *.*') do ( set "var=%%i" & ren "%%i" "!var:%str1%=%str2%! ")) pause复制代码
Five66 当前离线
上尉
@echo off set "str1=26" set "str2=28" Setlocal Enabledelayedexpansion for /f "eol=/ delims=" %%i in ('dir /b "D:\A-相关无用文件备份\20231226\- 模板备份1228\*.*"') do ( set "var=%%i" && ren "%%~fi" "%%dpi!var:%str1%=%str2%!") pause复制代码
TOP
qixiaobin0715 当前离线
大校
@echo off set "str1=26" set "str2=28" cd /d "D:\A-相关无用文件备份\20231226\- 模板备份1228" Setlocal Enabledelayedexpansion for /f "delims=" %%i in ('dir /s /b /a-d "*%str1%*"') do ( set "var=%%~nxi" ren "%%i" "!var:%str1%=%str2%!" )复制代码
_avatar_ 当前离线
上等兵
@echo off set "str1=26" set "str2=28" cd /d "D:\A-相关无用文件备份\20231226\- 模板备份1228" Setlocal Enabledelayedexpansion for /f "delims=" %%i in ('dir /s /b "*%str1%*"^|sort /r') do ( set "var=%%~nxi" ren "%%i" "!var:%str1%=%str2%!" )复制代码