Expert Software Company : News

miercuri, 19 mai 2010

Search Filenames with Wildcards in VFP using Script

In VFP, searching files using Wildcards can be done with
ADIR() function. However, there is also another method
aside from that and from using DIR/s which can also
yield the same result.

Search for files with filename AUTOEXEC which could have any
extension name.

MyScript = Createobject('Scripting.FileSystemObject')
loCollection = MyScript.GetFolder('C:\')

lcFileToSearch = 'AUTOEXEC' && Search for AUTOEXEC.*

For Each loObject In loCollection.Files
If Upper(Juststem(loObject.Name)) == Upper(m.lcFileToSearch)
? Upper(loObject.Name)
Endif
Endfor

Niciun comentariu:

Trimiteți un comentariu