VBScript to count the total number of files in a folder
kw.vbs
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set Folder = objFSO.GetFolder("D:\VBScript")
counter = 0
For Each File In Folder.Files
    counter = counter + 1
Next
print "Total Files " & counter
Output

Total Files 16

Advertisement