- @echo off
- setlocal enabledelayedexpansion
- for /d %%a in (2\*) do (
- set /a x+=1
- set #!x!=%%a
- )
- for /d %%b in (1\*) do (
- set /a y+=1
- set -!random!-!y!=%%b
- )
- set /a n=y/x
- set /a m=y%%x
- if !m! neq 0 set /a n+=1
- for /f "tokens=2 delims==" %%c in ('set -') do (
- set /a k+=1
- set /a l=(k-1^)/n+1
- for %%d in (#!l!) do (
- if not exist "!%%d!\%%~nxc" (
- md "!%%d!\%%~nxc"
- xcopy "%%c\*.*" "!%%d!\%%~nxc\" /s>nul
- )
- )
- )
- pause
复制代码
|