Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Join us in Bucharest on Sept 18th for Qlik's AI Reality Tour! Register Now
cancel
Showing results for 
Search instead for 
Did you mean: 
Anonymous
Not applicable

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
Labels (2)
3 Replies
Anonymous
Not applicable
Author

Hi,
Is your file named by date? 
Here is an option "Delete Folder" in tFtpDelete component.
Best regards
Sabrina
Anonymous
Not applicable
Author

Unfortunately no, our files are named according to a certain key. Also, it is not through FTP.
Anonymous
Not applicable
Author

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