Scripting Techniques Regular Expressions Match File Names in Directory Against Regular Expression
' Match File Names in Directory Against Regular Expression
Set objFS = CreateObject("Scripting.FileSystemObject") Set objShell = CreateObject("WScript.Shell") strCurrentDirectory = objShell.CurrentDirectory
Set objFolder = objFS.GetFolder(strCurrentDirectory) Set colFiles = objFolder.Files
Set objRE = New RegExp objRE.Global = True objRE.IgnoreCase = False objRE.Pattern = WScript.Arguments(0)
For Each objFile In colFiles bMatch = objRE.Test(objFile.Name) If bMatch Then WScript.Echo objFile.Name End If Next
|
VbsEdit includes all these samples!
Download Now!
Version 5.4.1 - This package includes VbsEdit 32-bit, VbsEdit 64-bit, HtaEdit 32-bit and HtaEdit 64-bit. The evaluation version never expires.
Home
Buy Now
HtaEdit
Support
Video
What's new ?
|