Hello all,

I need to impement a very complexe script to do the following :

We've a specific clients folder structure whick is the same for every clients (with 4 level of subfolders ..). We have different services in the company and clients can be clients of one or many different services but all have the same folder structure (when we enter a new client, it's structure is created automatically).
Now, I'd like to make a script running every night to hide empty folders of the structure (it's a wish of the users), in this way, than can see, if a part of the stucture is not displayed that they are not customer of this part. So, I'm trying to make a recursive script that allows to hide empty folders, but as soon as a folder is not empty, its parents don't have to be hidden, of course.

Here's what I made :

strComputer = "."
Const cFOL = "C:\DELL\"

'--------------------------------------------------------------
'* Declare Objects
'*--------------------------------------------------------------

Dim objFSO
Set objFSO = CreateObject("Scripting.FileSystemObject")

Bidon = RepVide(cFOL)
Set objFSO = Nothing

'***************************************
'* Routine de parcours de la structure
'***************************************
Function EmptyFolder(FolderSpec)
EmptyFolder = True
NoFile = True

For Each strFOL In objFSO.GetFolder(FolderSpec).Subfolders
NoFile = EmptyFolder(strFOL.Path)
Next

if (objFSO.GetFolder(FolderSpec).Files.Count) = 0 AND NoFile Then
EmptyFolder = True
Else
EmptyFolder = False
End if
End Function

This worked but as soon as I've 2 levels that are empty (even if the 3rd is not), the upper lever is considered to be hidde, which is not correct.

So, every help is welcome

Per advance, thanks for your help

Arnaud