@echo off
chcp 65001
set w=png
set /p str1=请输入要修改的文字(以回车结束):
set /p str2=请输入要改成的文字(若是删除则直接回车，以回车结束):
for /f "delims=" %%i in ('dir /b /a-d "*.%w%"' ) do (
set str3=%%i
setlocal EnableDelayedExpansion
set "str3=!str3:%str1%=%str2%!"
ren "%%i" "!str3!"
endlocal
)
set k=jpg
for /f "delims=" %%i in ('dir /b /a-d "*.%k%"' ) do (
set str3=%%i
setlocal EnableDelayedExpansion
set "str3=!str3:%str1%=%str2%!"
ren "%%i" "!str3!"
endlocal
)
set g=meta
for /f "delims=" %%i in ('dir /b /a-d "*.%g%"' ) do (
set str3=%%i
setlocal EnableDelayedExpansion
set "str3=!str3:%str1%=%str2%!"
ren "%%i" "!str3!"
endlocal
)

pause
