- @echo off
- setlocal
-
- set "SrcFolder=A"
- set "DstFolder=B"
-
- :input
- set /p N=请输入每个文件夹分配的文件个数:
- echo %N%|findstr /x "[0-9][0-9]*" >nul || goto input
-
- title 处理中...
-
- dir /b "%SrcFolder%" >..list
-
- (
- for /d /r "%DstFolder%\" %%a in (*) do (
- set Folder=%%a
- for /l %%n in (1 1 %N%) do (
- set /p File=
- setlocal enabledelayedexpansion
- move "!SrcFolder!\!File!" "!Folder!"
- endlocal
- )
- )
- ) <..list
-
- del ..list
-
- title 完成
- pause
复制代码
|