Function getfindfile()
pat = InputBox ("输入路径.","中国DOS联盟")
types = InputBox ("输入后缀名如: txt ","中国DOS联盟")
If (pat="" Or types="") Then
WScript.Quit
End If
Set fso = WScript.CreateObject ("scripting.filesystemobject")
Set fold = fso.GetFolder (pat)
Set fils = fold.Files
For Each fi In fils
filestr = filestr&Space (2)&fi&Space (2)
Next
getfindfile = RegExpTest ("[^*][\.]txt",filestr)
End Function
Function RegExpTest(patrn, strng)
Dim regEx, Match, Matches
Set regEx = New RegExp
regEx.Pattern = patrn
regEx.IgnoreCase = True
regEx.Global = True
Set Matches = regEx.Execute(strng)
For Each Match in Matches
RetStr = retstr & Chr (13) &Match.Value & Chr(13)
Next
RegExpTest = RetStr
End Function
WScript.Echo getfindfile ()