VBScript retrieve filenames using wildcard
Posted on 2007-03-19
Is there a way in VBScript to retrieve a list of the files in a folder using wildcards?
My script uses the FileSystemObject (fso.GetFolder) but this returns all files in the specified folder.
There are at least a thousand files in the folder but I want to retrieve a subset, similar to DIR AP*.xml.
My kludgy solution is to test each filename ... IF Left(strFilename,2) = "AP" ... but as I have to test so many files this is unacceptably slow. Note that I am retrieving the folder contents from a mapped drive on a remote server.