How to delete unnecessary/old files from a folder using LINQ in UiPath

Опубликовано: 17 Март 2026
на канале: Learn Tech with Mannoj
193
2

Problem statement - We need to remove the old/outdated files
which hasn't been accessed for the last 6 month from a folder

Here is the query
From file In Directory.GetFiles(FolderPath, "*.*", _
SearchOption.AllDirectories) _
Let curfile = New FileInfo(file) _
Where curfile.LastAccessTime (lessthan)= DateTime.Now.AddMonths(-6) _
Select curfile

Code:https://github.com/manojbatra071/UiPa...

Medium:   / how-to-delete-unnecessary-old-files-from-a...  

#rpa #oneminuterpa #uipath #uipathrpa #uipathdeveloper