Delete files starting with “Temp” in a folder in one go.
I know this can be achieved by running a loop on items in folder but I want to achieve it without loop.
How this can be done?
Also, is there way, we can delete multiple files using Delete activity in uipath or any other activity?
Why are you trying to avoid a loop? It’s the proper way to do it.
Bcoj it might not be quicker when there are thousands to such files, hence looking for an alternative way.
I found this on the forums. Would a modified version of this help at all?
The part that takes any time is the actual deletion of the files, not the loop. Either way you’re still deleting thousands of files.
Try as below, Use Invoke Code and write as below
Array.ForEach(Directory.GetFiles("FolderPath"), Sub(X) File.Delete(X))
Hope this may help you