Delete file?

I want delete file in folder data (Except in folder Input,Output,Temp)

image

Please guide me about it.

Hi,

If you want to delete not folders but files, can you try the following?

Regards,

1 Like

Hi if the names of file and path is constant then you can use delete file activity , or if you want to delete xlsx files inside a folder then you can use directory.getfiles((Folderpath),“*.xlsx”)
and loop the files and use delete activity

1 Like

Hi @fairymemay

If these are files generated from the automation, then I’d recommend creating a Separate Folder such as a “Temp Folder” and then either delete the Folder itself or the items within that folder.

Best thing about this, is you can create an Asset with the Temp Folder Directory and the robot will target the exact items you want to delete.

This leads to easier clean up.

Kind Regards,
Ashwin A.K

1 Like

@Yoichi It error as below.

Hi,

Can you try either of the following because you use C#.

"D:\\RPA\\Distribution\\DPM_CustomerCampaign3_Bag\\Data"

OR

@"D:\RPA\Distribution\DPM_CustomerCampaign3_Bag\Data"

Regards,

1 Like