CODE: [Copy to clipboard]@echo off&setlocal enabledelayedexpansion for /f "delims=" %%i in ('dir /s /b *.txt') do ( set /a n+=1 ren "%%i" !n!.txt ) echo 重命名完成! pause>nul