One Star

Delete empty folders

I am currently working on a job to remove files that are older than 6 months old from multiple folders and sub folders. I have got this portion to work correctly.

 

However, I would like to now remove any remaining folders that contain no files. (all of the files were deleted from the first portion of the job and the folder is now empty). I am able to remove the folders however I cannot figure out how to do this based on the content that either remains or does not within the folder, thus they are all deleted no matter what. 

 

Capture.PNG

  • Data Integration
2 REPLIES
Eleven Stars TRF
Eleven Stars

Re: Delete empty folders

Use tFileList to check if there is at least 1 file or not. Is it what you're looking for?

TRF
One Star

Re: Delete empty folders

That would work I imagine if that is possible? I want to delete any Folder that is empty but make sure I keep folders that contain files (the files that remain should be newer than 6 months from my previous job)