Here you go. I got it! Let me know if this works out better for you--
Dim goFso, gcsFolder, gcsSubFolder, lcsSubFolder
Set goFso = CreateObject("Scripting.FileSystemObject")
set gcsFolder = goFso.GetFolder("E:\programming\vbs")
Call CountFiles(gcsFolder)
Set gcsSubFolder = gcsFolder.SubFolders
Call countFiles(SubFolder)
Dim folCnt, filCnt
Sub CountFiles(folder)
Dim lcsFolder, lcsSubFolder
set lcsFolder = goFso.GetFolder(folder)
filCnt = filCnt + lcsFolder.files.count
set lcsSubFolder = lcsFolder.SubFolders
folCnt = folCnt + lcsSubFolder.count
For Each sSubFolder In lcsSubFolder
Call CountFiles(sSubFolder)
Next
Set lcsSubFolder = Nothing
Set lcsFolder = nothing
End Sub
WScript.Echo("Folder Count: " & folCnt)
WScript.Echo("Filer Count: " & filCnt)
Set gcsSubFolder = nothing
set gcsFolder = nothing
Set goFso = nothing
I have copied it from random site..didnt check..pls check and let me know
if this is not working...I will create. Time limit Ravi.I m not free dis
week so..just copied
let me know,,
On Sunday, October 2, 2016 at 3:48:36 PM UTC+2, Ravikiran wrote:
>
> Hi All,
> I need total count number of folders and names in the root
> directory(subfolders may have sub folders). So need total count and names.
>
> Thanks,
> Ravi kiran
>
--
--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en
---
You received this message because you are subscribed to the Google Groups "QTP
- HP Quick Test Professional - Automated Software Testing" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/d/optout.