Stefan_Soderquist
asked on
VBScript to list subfolders, but only 3 levels deep
Hi!
I'm looking for a VBScript that can list all subfolders in a directory, but only the first 3 levels deep and export it to a textfile.
I have earlier used the command "dir [path] /AD /S /B >"All folders.txt" in a batchfile to get a complete list of all subfolders in a directory,
but now I need a way to get the same listing but only the first three levels down.
I'm looking for a VBScript that can list all subfolders in a directory, but only the first 3 levels deep and export it to a textfile.
I have earlier used the command "dir [path] /AD /S /B >"All folders.txt" in a batchfile to get a complete list of all subfolders in a directory,
but now I need a way to get the same listing but only the first three levels down.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Thanks, and you're welcome.
ASKER
I only needed the folders, but it was easy to change (removed line 39-41)
Thanks for the script and the fast response. Job well done!