- @echo off
- setlocal enabledelayedexpansion
- for /f %%a in ('dir /a-d /b^|find /v /c ""') do (
- set /a ccc=%%a-1
- echo;当前文件夹中共有文件!ccc!个(不包括批处理自身)
- echo;请指定每个新文件夹装多少个文件(不移动批处理自身)
- )
- set /p num=:
- set /a fd=1
- set /a fl=0
- md folder!fd!
- for /f "delims=" %%a in ('dir /a-d /b *.*^|find /v "%~nx0"') do (
- if !fl! equ %num% (
- set /a fd+=1
- md folder!fd!
- set /a fl=0
- )
- move "%%~a" folder!fd!
- set /a fl+=1
- )
- pause
复制代码
|