I'm using the FORFILES utility to delete files from folders older than 'X' days.
forfiles /p "i:\objectscripts" /s /m *.* /c "cmd /c del @path" /d -120
I have it scheduled as a CmdExec type job on SQL 2005 (Server 2003). However, if there are no files to delete, the job fails with an error:
"ERROR: No files found with the specified search criteria. Process Exit Code 1. The step failed."
I'd rather not have the SQL job show as failed. Does anyone have an idea how to prevent failure ?