@echo off
setlocal EnableDelayedExpansion
REM Assumes %DATE% ends in MM/DD/YYYY format, adjust as needed
set Today=%DATE:~-2,2%%DATE:~-10,2%%DATE:~-7,2%
REM Define source folder, and base for destination folders
set FromDir=c:\temp
set DestDir1=C:\folder\upload
set DestDir2=C:\folder2\upload
set DestDir3=C:\folder3\upload
set DestDir4=C:\folder4\upload
REM Loop through allfiles in source folder, calculate a dest folder, and move them
set Folder=0
for %%A in ("%FromDir%\*%Today%*") do (
set /A "Folder = (!Folder! %% 4) + 1"
call :CopyFile "%%A" "DestDir!Folder!"
)
:CopyFile
ECHO move "%~1" "!%~2!"
exit /b
|