I found a script on another question that accepts a baseroot string and then gets all subfolders within that baseroot. It works fine for the first level of subfolders, but I need it to return the subfolders of the subfolders etc. The directory tree may go down 10 or 15 levels, but I need each subdirectory to be added to the array. The function I found previously was:
Set oBaseFolder = oFSO.GetFolder(BaseFolder)
For Each SubFolder In oBaseFolder.SubFolders
If Not IsEmpty(SubFolder) Then
strArr = strArr & "+" & Mid(SubFolder, Len(BaseFolder) + 1)
GetFolders = Split(Mid(strArr, 2), "+")
Set oBaseFolder = Nothing
Where basefolder might be "\\servername\share\directory" There are essentially thousands of subdirectories in that baseroot, but the above function only returns the 12 main subdirectories directly below the root. Thanks!