While automating business processes, we deal with a lot of files and might perform few activities on them like deleting, moving or renaming.
Here, for now, let’s see how to delete multiple files from a folder!!!
Replace our_DirectoryPath with your desired folder path
Implementation using UiPath :
Let us implement a project to delete multiple files from a given folder 🙂
Drag “Assign” activity into the designer panel and supply the “Folder Path” to it.
Drag “If” activity to check if the folder contains any files.
Directory.GetFiles(DirectoryPath).Count > 0
Drag “Invoke Code” activity, supply the below-mentioned code to it to and pass the folder’s Path from which we have to delete the files.
Now, execute the workflow to find the result 🙂
Click here to download the Source Code…
Hope it has helped you…