Hi,
How to delete all file in folder?
I need to check folder if the file is exists and delete all the files in the folder.
Hi,
How to delete all file in folder?
I need to check folder if the file is exists and delete all the files in the folder.
Create a Boolean datatype variable Bool_FileExist.
- Assign -> Bool_FileExist = If(Directory.GetFiles("Give Folder Path here").Count>=1, True, False)
→ Take an If activity to check the condition,
- Condition -> Bool_FileExist = True
→ Inside then block insert the For each file in folder activity to iterate the each file in the folder. Output is CurrentFile.
→ Inside For each file in folder activity insert the Delete file activity and give CurrentFile.toString as input.
Check the below workflow for better understanding,
Hope it helps!!
Hie @Gowthaman_Subramanian for this you may go with this approach hope it will work on your case …
i"m attaching shreeshot for this method
Folder path - variable is string

Hope it work for you .
mark this solution if you find it work for you
cheers Happy Automation ![]()
Do you want to delete a single file in the folder or all files in a folder.
I want to delete all the file in that folder.
Have you tried the process steps that I have mentioned in the above post. It not worked for you…? @Gowthaman_Subramanian
Thanks Mahesh. Yes I tried, it is working.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.