|
|
|
|
|
Dicas
|
|
Visual Basic (ActiveX/Controles/DLL)
|
|
|
Título da Dica: Contando o nº de arquinos em um drive
|
|
|
|
Postada em 9/5/2005 por Josefh Hennyere
Option Explicit Dim tFlcnt As Long Dim FSO As New FileSystemObject Dim fd As Scripting.Folder Sub CountFiles(dDrive As String) On Error Resume Next tFlcnt = tFlcnt + FSO.GetFolder(dDrive).Files.Count For Each fd In FSO.GetFolder(dDrive).SubFolders If Right(fd.Path, 1) = "" Then CountFiles fd.Path & fd.Name Else CountFiles fd.ParentFolder & "" & fd.Name End If Next End Sub Private Sub Form_Load() Call CountFiles("C:") MsgBox "O drive C: tem " & tFlcnt & " arquivos!" End Sub
'Josefh Hennyere
|
|
|
|
|