-
how do i check if a directory is empty. For example, lets assume i have directory call "app" in the path "c:\app". i want to check this directory is empty. if is not empty i want to read what ever inside the dirctory "app". Maybe i have one file or bunch of file. Now with out knowing the file name how do i read what ever inside the directory "apps"
thankx
amal
-
Use the Dir function.
Code:
Private Sub Command1_Click()
Dim FileFinder
List1.Clear
FileFinder = Dir("C:\Windows\")
Do Until FileFinder = ""
List1.AddItem LCase(FileFinder)
FileFinder = Dir
Loop
End Sub
What it will do is add all the files in a directory to a Listbox, if there are no files in a directory, than it won't list anything.