Break On
COLOR C+
:Loop ; loop over all
SLEEP 1
'Suche was...' ?
; -----------------------------------AG Coupons Übernahme Galileo Berlin------------------------------------------------------------
; Variablen RESET------------------------------------------------------------------------------------------------------------
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, $CPath ; Source, Copy and Destination paths
Dim $File ; Name of file being processed
Dim $DstDir ; Full destination path as created
$aMonate = Split('x,JAN,FEB,MAR,APR,MAY,JUN,JUL,AUG,SEP,OCT,NOV,DEC', ',') ; name of month in Array
$SPath = 'C:\etic\Kopie\' ; Sorce dir
$DPath = 'T:\agcoupons\galileo\berlin\' ; target dir
$CPath = 'G:\MIR92\' ; copy dir
$File = Dir($SPath) ; Variable file
; getting the 1. file
While Not @ERROR
if not (getfileattr($File) & 16) ; if file is not a dir.
;'copy ' $SPath $File ? ; reading, what's going on
'move ' $SPath $File ? ; reading, what's going on
$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 ; target dir
; creating the target dir if not exist
If Not Exist($DstDir)
'MD ' $DstDir ? ; for Debugging
MD $DstDir ; creating the target dir
EndIf
SLEEP 1 ; slowing down for reading
; move file into the target dir::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
SLEEP 1 ; slowing down for reading
Move $SPath + $File $DstDir ; enable executing
EndIf
$File = Dir() ; getting next file
Loop
GOTO "Loop"