Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in RPA by (12.7k points)

I want to go over a directory and delete all files older than x, in Uipath. My problem is that I don't know how to go over another folder that may be inside.

Here is what I have.

And here

1 Answer

0 votes
by (29.5k points)
To go over each file in a folder and the potential subfolders you can do the following:

Directory.EnumerateFiles(root, "*.*", SearchOption.AllDirectories).
Then to get information about the file you can use File.GetAttributes(file) and return a FileAttributes object which will give detailed information about the file's creation date etc.

Related questions

0 votes
1 answer
asked Jul 19, 2019 in RPA by noah kapoor (5.3k points)
0 votes
1 answer
asked Jul 22, 2019 in RPA by noah kapoor (5.3k points)
0 votes
1 answer
0 votes
1 answer
asked Nov 20, 2020 in RPA by dev_sk2311 (45k points)

Browse Categories

...