Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Check For Empty Folder

Status
Not open for further replies.

Hackster

Programmer
Mar 28, 2001
173
US
I know who to check to see if a folder exists, but how do I check to see if an existing folder is empty? I don't need to know what files are in it, I just need to know whether it has any files or no files.

Thanks.
 
Here is a non-FSO based solution:

Code:
If Dir("C:\TestDir\*.*") = "" Then
     'Directory Is Empty
Else
     'It has one or more files in it
End If
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top