Break On
Dim $FileDate ; File timestamp
Dim $FileYear ; Year of file timestamp
Dim $FileMonth ; Month of file timestamp
Dim $FileDay ; Day of file timestamp
Dim $aMonate ; Array of month names
Dim $SPAth, $DPath ; Source and Destination paths
Dim $File ; Name of file being processed
Dim $DstDir ; Full destination path as created
; define array of month names
$aMonate = Split('x,JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC', ',')
$SPath = 'c:\temp\Src\' ; where the files are...
$DPath = 'C:\Temp\dest\' ; where the files go...
$File = Dir($SPath + '*.*')
; get first file name
While Not @ERROR
If $File <> '.' And $File <> '..'
'Processing ' $SPath $File ? ; for debugging
$FileDate = GetFileTime($SPath + $File)
$FileYear = SubStr($FileDate,1,4)
$FileMonth = $aMonate[Val(SubStr($FileDate, 6, 2))]
$FileDay = Right('0'+SubStr($FileDate,9,2),2)
$TypeFound = 0
$DstDir = $DPath + $FileYear + '\' + $FileMonth + '\' + $FileDay
; create the destination directory, if needed
If Not Exist($DstDir)
'MD ' $DstDir ? ; for debugging
MD $DstDir ; create the destination dir
EndIf
; move the file to the destination folder
'Move ' $SPath + $File + ' ' + $DstDir ; for debugging
Move $SPath + $File $DstDir ; uncomment for production
EndIf
$File = Dir() ; get next file name
Loop