请把脚本放在D:下的新建文件夹里
@echo off & setlocal enabledelayedexpansion
for /r %%a in (*.doc) do (
if /i "%%~xa"==".doc" (
set "Str=%%~na.tmp$"
set "Str=!Str:_=!"
ren "%%~a" "!Str!"
ren "%%~dpa!Str!" "!Str:-=!"
)
)
for /r %%a in (*.tmp$) do if /i "%%~xa"==".tmp$" ren "%%~a" "%%~na.doc"
pause