11-30-2022
11:57 PM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
11-30-2022
11:57 PM
Hi there.
You have to create a Directory Info object using the path of the folder that contains files you want to delete. And look for all files inside of it "Test*.text"
If you want to look for all sub folders, You can use this:
Dim dinfo As New DirectoryInfo(YOUR_FOLDER_PATH)
For Each myFile In dinfo.GetFiles("Test*.txt", SearchOption.AllDirectories)
File.Delete(myFile)
Next If you want to check only the folder you entered, not the subfolders then you have to change "SearchOption.AllDirectories" to "SearchOption.TopDirectoryOnly".
I hope it will help.
Regards
Devrim
If my answer is solved your problem, please mark it as Solution
Freundliche Grüße / Kind Regards
Freundliche Grüße / Kind Regards