Count No of Files

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Ali Rizwan
    Banned
    Contributor
    • Aug 2007
    • 931

    Count No of Files

    Hello all,

    I want to count no of files in a folder??
    Suppose i have a folder name abc then my code count the number of files it contains.

    Using VB6

    Thanx
    >> ALI <<
  • ubentook
    New Member
    • Dec 2007
    • 58

    #2
    Sub CountThemCritte rs()
    Dim strPath As String
    Dim oFSO As Object
    Dim oFolder As Object
    Dim N As Long
    strPath = "C:\Documen ts and Settings\user\M y Documents\My Pictures"
    Set oFSO = CreateObject("S cripting.FileSy stemObject")
    Set oFolder = oFSO.GetFolder( strPath)
    N = oFolder.Files.C ount
    MsgBox N
    Set oFSO = Nothing
    Set oFolder = Nothing
    End Sub



    Originally posted by Ali Rizwan
    Hello all,
    I want to count no of files in a folder??
    Suppose i have a folder name abc then my code count the number of files it contains.
    Using VB6
    Thanx
    >> ALI <<

    Comment

    Working...