Listing One

Sub ShowDriveList()
 Dim fs, d, dc, s, n
 Set fs = CreateObject("Scripting.FileSystemObject")
 Set dc = fs.Drives
 For Each d In dc
   s = s & d.DriveLetter & " - "
   If d.DriveType = Remote Then
       n = d.ShareName
   Else
       n = d.VolumeName
   End If
   s = s & n & vbCrLf
 Next
 MsgBox s
End Sub

Listing Two

Sub ShowDriveList()
 Dim filesys, drive, drivecollection, message, volname
 Set filesys = CreateObject("Scripting.FileSystemObject")
 Set drivecollection = filesys.Drives
 For Each drive In drivecollection
   message = message & drive.DriveLetter & " - "
   If drive.DriveType = Remote Then
       volname = drive.ShareName
   ElseIf drive.IsReady Then
       volname = drive.VolumeName
   Else
       volname = "Unknown"
   End If
   message = message & volname & vbCrLf
 Next
 MsgBox message
End Sub

Listing Three

Private Sub Form_Load()
 InitFolderList
End Sub

Sub InitFolderList()
 Dim filesys, root, subfolders, folder
    
 Set filesys = CreateObject("Scripting.FileSystemObject")
 Set root = filesys.GetFolder("c:\")
 Set subfolders = root.subfolders
   
 For Each folder In subfolders
   List1.AddItem folder.Path
 Next
End Sub