cjreynolds
08-12-2009, 07:39 PM
Working in VB6 - I have a folder with 600+ subfolders, about 6000 files. When I go to the folder's properties dialog, it says the folder has 6040 files (in 684 folders). Yet, when I run the code:
Sub ScanFolders()
Dim SubFolders As Integer
Dim i As Integer
TotalFiles = TotalFiles + File1.ListCount
SubFolders = Dir1.ListCount
If SubFolders > 0 Then
For i = 0 To SubFolders - 1
ChDir Dir1.List(i)
Dir1.Path = Dir1.List(i)
ScanFolders
Next
End If
File1.Path = Dir1.Path
MoveUp
End Sub
it counts only 5947 files - almost 100 files less. When I do a Dir /s from a dos prompt (or whatever they call it now), I get 5332 files - adding /A:H to the dir command, it reports 709 hidden files, adding up to 6041 files total (only one off from the Properties dialog). It shows 1970 folders, which can't be right, but I'm not worried about that.
I have my filelistbox's Hidden property set to True, so it's counting the hidden files. What else could it be missing?
joe
Sub ScanFolders()
Dim SubFolders As Integer
Dim i As Integer
TotalFiles = TotalFiles + File1.ListCount
SubFolders = Dir1.ListCount
If SubFolders > 0 Then
For i = 0 To SubFolders - 1
ChDir Dir1.List(i)
Dir1.Path = Dir1.List(i)
ScanFolders
Next
End If
File1.Path = Dir1.Path
MoveUp
End Sub
it counts only 5947 files - almost 100 files less. When I do a Dir /s from a dos prompt (or whatever they call it now), I get 5332 files - adding /A:H to the dir command, it reports 709 hidden files, adding up to 6041 files total (only one off from the Properties dialog). It shows 1970 folders, which can't be right, but I'm not worried about that.
I have my filelistbox's Hidden property set to True, so it's counting the hidden files. What else could it be missing?
joe