Maybe I don't understand your script, but I really don't see the need for the function(yet). Here is another version that will display the filename if the file exists, and then the error code when it deletes.


 Code:
  $FileNames="File1","File2","File3"
  for $x = 0 to ubound($Filenames)
    if exist($FileNames[$x])
      ? $filenames[$x] + " : "
      ;del $Filenames[$x] /c
      @serror
    endif
  next


Remove the semicolon on the del line when you have tested this and it appears to be working with the right set of files.
_________________________
(... better days ahead)