回复 5# gytqqq
抱歉,在细节的处理上有点问题,已改正。- @echo off
- @setlocal enabledelayedexpansion
-
- set num=1
- set name=0001
- call:count
-
- :main
- for /R %%i in (*.jpg,*.jpeg,*.png,*gif,*.bmp,*.ico,*.dib,*.jpe) do (
- if not %%~ni LSS %num% (
- rem echo rename "%%i" %name%%%~xi ---- %num%
- rename "%%i" %name%%%~xi
- set /A num=num+1
- call:int
- goto:main
- )
- )
- call:sleep 125
- goto:main
-
- :count
- rem 计算已重命名的文件数
- if exist %num%.jpg (
- set /A num=num+1
- call:int
- goto:count
- )
- goto:eof
-
- :int
- rem 统一格式
- set name=00000%num%
- set name=%name:~-4%
- goto:eof
-
- :sleep
- rem 防高频
- echo WScript.sleep %1 > sleep.vbs
- start /wait sleep.vbs
- del sleep.vbs
- goto:eof
复制代码 觉得满意的话请付款[滑稽] |