@echo off
setlocal enabledelayedexpansion
set /p strr=请输入要删除的字符串(输入完毕后按回车(Enter键)确认):
for /f "delims=" %%a in ('dir /a-d/b *') do (
set new=%%~a
ren "!new!" "!new:%strr%=!")
echo 字符“%strr%”已删除!&pause
新建txt文档
输入上述代码
将后缀由.txt更改为.bat
放在所需要处理的目录中,运行。