Getting Information about your Folders
Just knowing the drive letters on your computer isn’t very exciting, but using this information to display a list of folders starts getting a little more useful. The GetFolder method of the FileSystemObject returns a Folder object, which contains a whole lot of useful information about the folder, including its name, size and a collection of subfolders.
You may on occasion need to display or work with a list of sub-folders located within a parent folder. Thankfully, as with finding out what Drives your computer has access to, working with fodlers is easy using the Folders property of the FileSystemObject.
Dim strRoot As String
strRoot = "C:\"
Dim fso As New Scripting.FileSystemObject
Dim parent As Scripting.Folder
Dim children As Scripting.Folders
Dim child As Scripting.Folder
Set parent = fso.GetFolder(strRoot)
Set children = parent.SubFolders
For Each child In children
Next
Other Topics about Using the FileSystemObject
Getting Information About Your Drives
Getting Information About Your Files
Working with Text Files
Reading from Text Files
|