VBScript: Traverse Directories & Subdirectories Snippet

This snippet has come in handy quite a few times for me...

Call ListFolderContents("C:\Windows\System32\Drivers")

Sub ListFolderContents(path) set fs = CreateObject("Scripting.FileSystemObject") set folder = fs.GetFolder(path) Msgbox folder.path

For each item in folder.SubFolders ListFolderContents(item.Path) Next set folder = Nothing set fs = Nothing End Sub