1 @echo off 2 rem bat文件的文件名需要和代码内一致 3 echo 开始更改文件名...... 4 set /a num = 0 5 setlocal enabledelayedexpansion 6 for %%m in (*) do ( 7 if not "%%m" == "rename.bat" ( 8 set /a num = num + 1 9 ren %%m !num!%%~xm 10 ) 11 ) 12 ) 13 echo 文件名修改完毕...... 14 pause