How to delete all content in a main folder

Hi,

I know how to delete files from main folder. But I’m having trouble deleting folders in another folder.
For example: “C:\Users\Paulina\Desktop\Main folder\folder_1\excel_1”

Wants to delete everything from the main folder. There are several folders in the main folder with excel files in it.

Please help.

Hi @Paulina ,

First delete the files, then try to delete the folders.

Hi @sarathi125,

I found a solution. This method will delete folders (there may be files in them) that are in the main folder. It will not delete files that are in the main folder. So the title can be confusing but this solution is enough for me.

Main.xaml (6.4 KB)

Hi @Paulina

If you want to delete files and folders in a directory then check this xaml file

Delete Files and Folder in a Directory.xaml (6.4 KB)

I have made some changes in you workflow. Do check it.

Hi @kumar.varun2

Great. This enriched my knowledge of UiPath. Thank you very much :slight_smile:

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.