回复 6# wqj
图片顺序不连续V2.bat- @echo off
- cd /d "%~dp0"
- setlocal enabledelayedexpansion
- set "MaxNum=2"
- for /l %%i in (1,1,10) do (
- call :HandleFolder %%i
- )
-
- :HandleFolder
- md "%1" 2>nul
- set "FileNum=0"
- for /l %%j in (1,1,100) do (
- if !FileNum! lss !MaxNum! (
- if exist "%%j.jpg" (
- move "%%j.jpg" "%1\"
- set /a FileNum+=1
- ) else if exist "%%j.jpeg" (
- move "%%j.jpeg" "%1\"
- set /a FileNum+=1
- ) else if exist "%%j.png" (
- move "%%j.png" "%1\"
- set /a FileNum+=1
- ) else if exist "%%j.bmp" (
- move "%%j.bmp" "%1\"
- set /a FileNum+=1
- )
- ) else (
- goto :eof
- )
- )
复制代码
|