这个可以批量去掉文件名某个字符后面的内容,但字符还在,应该怎样修改
@echo off
setlocal enabledelayedexpansion
set /p str=请输入特定字符串:
for %%i in ("*%str%*") do (
set "FileName=%%i"
set "FileName1=!FileName:*%str%=!"
for %%a in ("!FileName1!") do set "FileName=!FileName:%%~na=!"
ren "%%i" "!FileName!"
)
pause