@echo off
Setlocal Enabledelayedexpansion
set "str=要替换的文字"
for /f "delims=" %%i in ('dir /b *.*') do (
set "var=%%i" & ren "%%i" "!var:%str%=!")