Hi,
In my opinion, its really hard to make this only with the BP Tools and I do not recommend to put this kind of maintenance task inside a Business Process.
But... challenge accepted!
Attached to this message you have the full project that I made. Basically, import it (also need to have Utility - Collection Manipulation and Utility - File Management)
How its works? Just call the action "Housekeeping" from the object. You need to indicate the folder that you want to clean up and the number of days that you want to delete (If you put 180 its start deleting files older than Today()-180 days)
Its also delete files in subdirectories from the first path. If you open the Object you will find a page called "CleanUpFolder". In the last stage calls itself (recursively) to go inside every subfolders. (If you have some problems to understand this kind of recursive functions, tell me and I'll explain you better)
This is how the CleanUpFolder page looks like:
My own recommendation for this problem...
Use this simple command line that you can launch from CMD
ForFiles /p "C:\My Folder" /s /d -30 /c "cmd /c del @file"
Only need to change the folder that you need and the days (C:\My Folder and -30 respectively)
If you create a .bat file, you can execute this from the Task Scheduler of Windows
It's faster, it's saver and it's better
Hope this helps you to fix your problem. And if this solves the issue, remember to mark this as the best answer
🙂Bye
🙂------------------------------
Pablo Sarabia
Architect
Altamira Assets Management
Madrid
634726270
------------------------------