README.md

December 4, 2022 ยท View on GitHub

Recursive Directory Listing

Description

This will list all the sub directories under a directory in a recursive manner. You may wish to remove the "msgbox" from the code and do something useful.

More Info

A directory name

As the process looks through all sub directories, it is a time consuming process. For testing purpose, use a directory which has few sub directories inside it.

Submitted On
BySubodh Dash
LevelIntermediate
User Rating5.0 (10 globes from 2 users)
CompatibilityASP (Active Server Pages), VbScript (browser/client side)

Category |Files World |ASP / VbScript Archive File |

API Declarations

Free to use /Free to distribute

Source Code

Option Explicit
Dim FSO
Set FSO = CreateObject("Scripting.FileSystemObject")
dim rd
rd = RecursiveDir ("c:\sheridan")
function RecursiveDir (path)
	dim folderpath, fol, FolderName
	Set folderpath = fso.getfolder(path)
	Set fol = folderpath.SubFolders
	For Each Foldername In fol
		msgbox Foldername
		RecursiveDir = FolderName
		RecursiveDir FolderName
	Next
end function