Scripting Techniques Text Files Deleting Files in a Directory with Names That Match a Regular Expression
' Deleting Files in a Directory with Names That Match a Regular Expression
strFolderName = "C:\scripts\textfiles\delete\" strREPattern = "log\d\d_\d\d05\.txt"
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFolder = objFS.GetFolder(strFolderName) Set objRE = new RegExp objRE.Pattern = strREPattern objRE.IgnoreCase = True
For Each objFile In objFolder.Files If objRE.Test(objFile.Name) Then objFS.DeleteFile(strFolderName & 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 ?
|