Dim fsoIO
Dim folQuelle, filQuelle, filDatei, filLog
Dim strfilDest, strfilLog, strfolZiel, strFilSrc
On Error resume next
Set fsoIO = CreateObject("Scripting.FileSystemObject")
Set folQuelle = fsoIO.GetFolder("C:\Users\sschirner\Desktop\vonhier")
strfolZiel = "\\Server-fs\Upload\test\nachhier\"
Set filQuelle = folQuelle.Files
strfilLog = strfolZiel & "bck_copy.log"
Set filLog = fsoio.OpenTextFile (strfilLog,8,true)
For Each filDatei In filQuelle
If lcase(right(filDatei.Name,3)) = "zip" Then
strfilDest = strfolZiel & year(now) & month(now) & day(now) & hour(now) & minute(now) & "." & fildatei.Name
strFilSrc = filDatei.Pathy
fsoio.MoveFile fildatei.Path, strfilDest
if err.number = 0 then
filLog.Writeline formatdatetime(now) & " - OK - " & strFilSrc & " -> " & strfilDest
else
filLog.Writeline formatdatetime(now) & " - FEHLER! - " & err.Description
err.clear
end if
End If
Next
filLog.close
if err.number <> 0 then
filLog.Writeline formatdatetime(now) & " - FEHLER! - " & err.Description
end if