Check if Folder is empty

Got a problem you cannot solve? Try here.
Post Reply
aziaaddini
Posts: 19
Joined: Mon Aug 20, 2012 5:30 am

Check if Folder is empty

Post by aziaaddini »

Hi,
Im sorry if this question was asked before, but i couldn't find anything regarding this. I need to check if a folder is empty? is there a way to do this.
I know Using Find all files will return the files, but that would slow down if there are many files in that location. All I need to do to see if there is a way to check if folder is empty or not?
Can you please advise.

Thanks you
FrancescoT
Site Admin
Posts: 5361
Joined: Sun Aug 22, 2010 4:28 am

Re: Check if Folder is empty

Post by FrancescoT »

Dear Aziaaddini,

the only option is to use the "Find All Files" command along with the "Search Subfolders" and "Include Directory Names" parameters.

If the folder is EMPTY, the command will return an empty string.

Otherwise, you should use a custom DLL/Exe for that.

Hope this helps you.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE
Post Reply