I'm trying to use the FileSystemObject to give me an entire system directory structure. I use:
For Each ADrive In LocalFileSystem.Drives
[ADD NODE TO DIRECTORY TREE]
If ADrive.IsReady Then
Set TheFolders = LocalFileSystem.GetFolder(ADrive.DriveLetter & ":\"![Wink ;) ;)](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
For Each AFolder In TheFolders.SubFolders
[ADD CHILD NODE TO DIRECTORY TREE]
Next
End If
Next
where [ADD NODE TO DIRECTORY TREE] and [ADD CHILD NODE TO DIRECTORY TREE] represent code for a 3rd party tree control. This works fine giving me a list of drives and the first level of folders in each drive. HOWEVER how would I go through every subfolder of each folder and then every level of folders after that?????
Any help would be much appreciated!
elziko
For Each ADrive In LocalFileSystem.Drives
[ADD NODE TO DIRECTORY TREE]
If ADrive.IsReady Then
Set TheFolders = LocalFileSystem.GetFolder(ADrive.DriveLetter & ":\"
For Each AFolder In TheFolders.SubFolders
[ADD CHILD NODE TO DIRECTORY TREE]
Next
End If
Next
where [ADD NODE TO DIRECTORY TREE] and [ADD CHILD NODE TO DIRECTORY TREE] represent code for a 3rd party tree control. This works fine giving me a list of drives and the first level of folders in each drive. HOWEVER how would I go through every subfolder of each folder and then every level of folders after that?????
Any help would be much appreciated!
elziko