本帖最后由 apang 于 2012-4-10 21:51 编辑
- @echo off&setlocal enabledelayedexpansion
- pushd "d:\123"
- for /f "delims=" %%a in ('dir /a-d /b *.*') do (
- set var=%%~za&set n=1
- call :lp
- if !n! gtr 4 (ren "%%a" "99999%%a"
- ) else (
- if "!n!"=="4" if !var! gtr 5120 ren "%%a" "99999%%a"
- )
- )
- goto :eof
- :lp
- if not "!var:~%n%!"=="" set/a n+=1&goto lp
复制代码
|