Need help. How to delete files in folder which are files name dose not contain key words?
Hi @Rashidi_Ahmad , you can use directory.get files() to get list of all files in a directory. Then you can use an if condition inside a loop to delete files that do not have names as required.
Please refer to the screenshot of the xaml attached below.
- In if condition use the desired condition of the keyword.
Hi, @Rashidi_Ahmad you can use directory.getfiles(path,“*”) and use for each loop and use delete activity and use item.tostring
Hi @Rashidi_Ahmad - you can use
not contain keyword as shown below…
Code : Directory.GetFiles(FolderPath).Where(Function(n) not path.GetFileName(n).Contains(YourKeyword)).ToArray
Please try like this…
Thanks it works as what i need. Thanks a lot
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.