本帖最后由 545810831 于 2015-1-9 22:13 编辑
- @echo off
- setlocal enabledelayedexpansion
- for /f "delims=" %%i in ('dir /b *.jpg*') do (
- set /a m+=1
- set a=%%~xi
- set _!m!=!a:.=!
- )
- set max=0
- :stat
- set /a d+=1
- if !_%d%! gtr !max! (
- set max=!_%d%!
- )
- if %d% lss !m! goto stat
- echo !max!
- for /f "delims=" %%i in ('dir /b *.jpg*') do (
- set a=%%~xi
- set k=!a:.=!
- if !k! lss !max! del "%%i"
- )
- pause
复制代码
|