>************************************************************************************ > >SELECT email_anexo >scan for EMAIL_ANEXO.SPAM = .T. > >MSG = SYS(5)+ CURDIR()+ emails.msg_path >MSGTX = SYS(5)+ CURDIR()+ emails.msgtx_path > > DELETE FILE (MSG) >DELETE FILE (MSGTX) > > IF NOT FILE (anexosPath + ALLTRIM(email_anexo.ANEXO)) > THISFORM.TEXT3.Value = THISFORM.TEXT3.Value + 1 > ENDIF > *THISFORM.REFRESH > > Should it be here (anexosPath + ALLTRIM(email_anexo.ANEXO)) ) You may simply put this into try/catch block to "hide"/ignore the errors try > DELETE FILE (anexosPath + ALLTRIM(email_anexo.ANEXO) ) catch to loException ** Could be an invalid path here endtry > >ENDSCAN >****************************************See some comments inside your code.