I have a script below that goes into a specified directory and searches for 2 file extensions.
I know it's not setup correctly, I am needing help to get the script working correctly.
thanks for taking a look!
I know it's not setup correctly, I am needing help to get the script working correctly.
thanks for taking a look!
Code:
Option Explicit
Public TotalPathFiles As String
Public FSO As Object
Sub SearchFileCount()
Dim FilesInPath As String
Dim oFolder As Object
Dim oFiles As Object
Dim oFile As Object
Dim strExt(2) As String
Set FSO = CreateObject("Scripting.FileSystemObject")
Set oFolder = FSO.GetFolder("C:\TestCase")
Set oFiles = oFolder.Files
strExt(0) = "F01"
strExt(1) = "f01"
FilesInPath = 0
For Each oFile In oFolder.Files
[COLOR=red][B] If Right(oFile, 3) = UBound(Filter(strExt, oFile)) Then[/B][/COLOR]
[B][COLOR=red] FilesInPath = FilesInPath + 1[/COLOR][/B]
[B][COLOR=red] End If[/COLOR][/B]
Next
End Sub