It seems that the problem is in this line, i think about the last parameters Since i was not able to get the dates of the files i want to copy $tijd = StringRegExpReplace(FileGetTime($map & $test[$i], 1, 1), "(.{4})(.{2})(.{2})(.{2})(.{2})(.{2})", "${1}/${2}/${3} ${4}:${5}:${6}") Could you give me an hint for solving it?