- @echo off &setlocal enabledelayedexpansion
- set /p f=请输入关键字符(多个关键字用空格分隔开"AAA EEE GGG"):
- for %%x in (%f%) do (
- for /f "delims=" %%a in ('dir /b /s /ad ^| find "%%x" ^|sort /r') do (
- set str=%%~nxa&set newstr=!str:*%%x=%%x!
- rem 预览确认结果无误,再去除 echo 保存后,运行就是执行更名
- echo ren "%%a" "!newstr!"
- )
- )
- pause
- endlocal&exit/b
复制代码
|