朱科技 当前离线
一级士官
xp3000 当前离线
少尉
@echo off&setlocal enabledelayedexpansion set m=1 (for %%a in (*.jpg *.png *.bmp) do ( set/a "n+=1,1/(4*m-n+1)"||(set/am+=1) md !m!&move "%%a" .\!m!\ ))2>nul复制代码
评分人数
TOP
qixiaobin0715 当前离线
大校
netdzb 当前离线
上尉
newswan 当前离线
if %n%==4 ( set n=1 ) else ( set /a n+=1 )复制代码
@echo off setlocal enabledelayedexpansion for %%a in (*.jpg) do ( set /a n+=1 set /a "m=(n-1)/4+1" if not exist !m! md !m! move "%%a" "!m!" ) pause复制代码
went 当前离线
少校
powershell -c "Get-ChildItem *.jpg | Group-Object {[System.Math]::Ceiling($_.BaseName/4)} | foreach{$f = $_.Name;$_.Group | foreach {[void][System.IO.Directory]::CreateDirectory($f);$_.MoveTo($f + '\' + $_.Name)}}"复制代码
@echo off&setlocal enabledelayedexpansion for /f "tokens=1,* delims=:" %%a in ('dir /b/a-d/on *.jpg^|findstr /n .') do (set x=%%a) set m=1 for /l %%i in (1 1 !x!) do ( set/a "n+=1,1/(4*m-n+1)" 2>nul||(set/am+=1) md !m!&move "%%i.jpg" .\!m!\ ) pause复制代码