Hi
I need to count the number of iles in a folder.
I have amended a script I found:
This is fine but it will not do subdirectories
Please can someone assist?
strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2")
Set colFiles = objWMIService. _
ExecQuery("Select * from CIM_DataFile where Path = '\\currency\\'")
For Each objFile in colFiles
'Wscript.Echo objFile.Name
count1 = count1 + 1
'Wscript.Echo count1
Next
Wscript.Echo count1