Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
Dim MyFile, MyPath, MyName
Dim DirCount, FileCount as Long
MyPath = "c:\" ' Set the path.
MyName = Dir(MyPath, vbDirectory) ' Retrieve the first entry.
Do While MyName <> "" ' Start the loop.
' Ignore the current directory and the encompassing directory.
If MyName <> "." And MyName <> ".." Then
' Use bitwise comparison to check if MyName is a directory.
If (GetAttr(MyPath & MyName) And vbDirectory) = vbDirectory Then
DirCount = DirCount + 1 ' Count if a directory
Else 'Just a file
FileCount = FileCount + 1 'Count in a file
End If
End If
MyName = Dir ' Get next entry.
Loop
Msgbox "There are " & DirCount & " folders and " & FileCount & " files in " & MyPath & "."