@echo off set /p filename=请输入要替换的后缀名: echo. set /p filename2=请输入替换后的后缀名: echo. setlocal ENABLEDELAYEDEXPANSION for /f "tokens=*" %%i in ('dir /b *.%filename%') do ( for /f "tokens=1 delims=." %%j in ("%%i") do ren "%%i" "%%j.%filename2%" ) echo 替换成功!按任意键推出 pause