Break On
; define array of month names
$aMonate = Split('x,JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC', ',')
$SPath = 'c:\Testing\TestDateien\' ; where the files are...
$DPath = 'C:\Testing\t1\' ; where the files go...
$File = Dir($Path + '*.*')
; get first file name
While Not @ERROR
; 'Processing ' $Path $File ? ; for debugging
$FileDate = GetFileTime($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 ' $Path + $File + ' ' + $DstDir ; for debugging
Move $Path + $File $DstDir ; uncomment for production
$File = Dir() ; get next file name
Loop