How to find Folder or File serach using wildcards - vb script
Can any one let me know how to find the Folder or File serach in a given path using wildcards - vb script
Would either convert it to regex or use instr() while looping through the folders/files.
Set FSO = CreateObject("Scripting.FileSystemObject")
If fso.FileExists("D:\SendMeCode\*.txt") Then
MsgBox "File Exists"
MsgBox "File Does Not Exist"
Above code will check all files with extension *.txt similarly you can use Getfolder method of FSO and get all the files in that folder using for..each loop and store them in an array to later compare with your expected value.
In one scenario, where I was storing all the output excel file, I have to check the latest files so I was reading all names of files in a specific folder with attribute creation-date and then getting the latest one.
Hope this helps