Hi there !
First off I'd like to say I'm sorry for asking for help, normally I would deal with this stuff myself, but since I'm all new to VBS this has been a pain for me !
Okay, I work for a company with a DFSshare and we have had problems when the share looks empty.
I have to make a VBScript to look for empty folders.
"RootFolder" > "A lot of folders in here representing customers" > "This folder cannot be empty"
This is how far I got, but all it does is give me a glimps ):
Set FSO = CreateObject("Scripting.FileSystemObject")
'Define Root folder
ShowSubfolders FSO.GetFolder("C:\DFSRoots")
Sub ShowSubFolders(Folder)
'For Each folder, create another For Each instance
For Each Subfolder in Folder.SubFolders
For Each subdir in Subfolder.SubFolders
'Create Status to contain the result
Status = 0
'Grab path of the folder to check for empty...ness
set folder = FSO.GetFolder(subdir.Path)
'If subdir.Path contains no files, nor folders throw Status 2, otherwise Status 0
If folder.Files.Count + folder.SubFolders.Count = 0 Then
Status = 2
WScript.Echo Status
Else
Status = 0
WScript.Echo Status
End If
Next
Next
End Sub
It would be awesome with a whole code snippet, but a wift in the right direction is also okay :)
Thanks !