Ok, Ive got a vbscript that iterates through a directory and its subfolders to retrieve a list of files. Example here:
Set FSO = CreateObject("Scripting.FileSystemObject")
ShowSubfolders FSO.GetFolder("C:\Scripts")
Sub ShowSubFolders(Folder)
For Each Subfolder in Folder.SubFolders
Wscript.Echo Subfolder.Path
ShowSubFolders Subfolder
Next
End Sub
Now this is great for getting an extensive list, but horrible on performance if there is a deep folder hierachy.
So my question is, is there a way to edit this part of the script so that it only iterates through a set number of levels of subfolders? Due to the depths of folder structures an ideal amount of levels to drill down into would be 3 levels.