One Star

tFileList & tFileDelete - check and delete empty folders

Hello,
Is there a way to check a directory's subfolders if they are empty, and have them deleted?
Right now I check all the files in all subfolders and delete them if they are older than 24hours
But after that, Id like to also delete subfolders that are empty since all their files are older than 24hours and hence deleted.
Regards
3 REPLIES
Moderator

Re: tFileList & tFileDelete - check and delete empty folders

Hi,
Is your file named by date? 
Here is an option "Delete Folder" in tFtpDelete component.
Best regards
Sabrina
--
Don't forget to give kudos when a reply is helpful and click Accept the solution when you think you're good with it.
One Star

Re: tFileList & tFileDelete - check and delete empty folders

Unfortunately no, our files are named according to a certain key. Also, it is not through FTP.
Five Stars

Re: tFileList & tFileDelete - check and delete empty folders

Hej Junmilsso,

i know the post ist old, but maybe someone have the same issue as you.
I found a solution, you can use the tSystem-Component and insert the following Code:

//with context-variable
"ROBOCOPY " + context.strArchiv_Folder_Path + " " + context.strArchiv_Folder_Path + " /S /MOVE"

//with fixed-value
"ROBOCOPY //muc1-vm0137/Scripte$/EXP/_IPAM_2.0/_archiv //muc1-vm0137/Scripte$/EXP/_IPAM_2.0/_archiv /S /MOVE"

The script will delete all empty Folder under your Directory.

 

 

Greetings

Magerquark