VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,726 questions
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
Hi,
I have a root directory at N:\DemoLab with following directory structure of known folders (Months,Years,Weeks) and unknown folders (DynamicName, RandomName etc.)
DemoFile.txt is available under all these sub-directories (regardless if it's dynamically folders or manually created).
Can we check parent directory path N:\DemoLab and search all folders and remove DemoFile.Txt if found in VB.net?
This seems to work too:
Dim r As New DirectoryInfo("N:\DemoLab")
For Each f In r.EnumerateFiles("DemoFile.txt", SearchOption.AllDirectories)
f.Delete()
Next