VB Code:
'Code description: Gets the number of 'files in a directory using the fileStystemObject 'And the Drive listbox and Dir listbox controls. 'Add a reference to Microsoft Scripting Runtimes Option Explicit Dim fso As New FileSystemObject Dim fol As Folder Private Sub Command1_Click() Set fol = fso.GetFolder(Dir1.Path) MsgBox (fol.Files.Count) Set fol = Nothing End Sub Private Sub Drive1_Change() Dir1.Path = Drive1.Drive End Sub


Reply With Quote