It's been working great!..
Recently I've needed to move the same number images from a larger total of 15120 images.
The first 9999 images seem to work fine but anything beyond this amount causes strange grouping orders,.
Is there any way to modify the code to handle larger volumes of images?
Thanks
Code: Select all
@echo off
setlocal enabledelayedexpansion
set "sourcedir=Z:\EV_3D_Scenes\3D_Renders"
set "destdir=Z:\EV_3D_Scenes\3D_Renders\Images_"
cd /d "%sourcedir%
for %%a in (*) do (
for /f "tokens=1,2* delims=_." %%b in ("%%~a") do (
set /a "folderext=(10000%%c %% 10000 - 1) / 40 + 1" && set /a "newincr=(10000%%c %% 10000 - 1) %% 40 + 1"
md "%destdir%!folderext!" >nul 2>nul
set newincr=000!newincr!
move /y "%%~a" "%destdir%!folderext!\%%~b_!newincr:~-4!.%%~d"
)
)