Batch/.bat file with del command blocked

I have a batch file that contains the below command that is being blocked. I want run it daily to clean out my security cam files that go to this ftp folder.
I’ve tried adding exceptions, but nothing seems to work. Thanks.

forfiles /p “C:\Users\me\documents\ftp” /s /m *.jpg /c “cmd /c Del @path” /d -5

You don’t say what Avast Program and version/build that you have ?

I can only assume that you have the Avast Ransomware Shield (RS) component enabled (and that might be blocking it) ?
I don’t use the RS component (haven’t got it installed), so can’t speak from personal experience.

That folder might be included in the folders protected by the RS, in the RS settings you may be able to either exclude that folder from protection or add an exception for the command file.

Avast One Essential free version
21.9.2494 (build 21.9.6698.704)

Thanks very much, I see that I can exclude folders. & I cam move my ftp storage location.

You’re welcome.