你这样,直接补0就是了,如果文件名有缺失/不连续的数字才有必要按大小排序- @echo off
- set info=互助互利,支付宝扫码头像,感谢赞助
- rem 有问题,可加QQ956535081及时沟通
- title %info%
- cd /d "%~dp0"
- for /f "delims=" %%a in ('dir /a-d/b *.jpg *.tif') do (
- set "f=%%a"
- set "newname=0000%%~na"
- setlocal enabledelayedexpansion
- echo;"!f!" --^> "!newname:~-3!%%~xa"
- ren "!f!" "!newname:~-3!%%~xa"
- endlocal
- )
- echo;%info%
- pause
复制代码
|