Created
May 17, 2012 05:39
-
-
Save ebibibi/2716715 to your computer and use it in GitHub Desktop.
[vbscript]get all files recursively
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Set resultFiles = CreateObject("Scripting.Dictionary") | |
| GetAllFiles "C:\tmp", resultFiles | |
| For Each file in resultFiles.Items | |
| WScript.Echo file.Path | |
| Next | |
| Function GetAllFiles(folder, resultFiles) | |
| Set fso = CreateObject("Scripting.FileSystemObject") | |
| Set folder = fso.GetFolder(folder) | |
| Set files = folder.Files | |
| For Each file in files | |
| resultFiles.Add resultFiles.Count, file | |
| Next | |
| Set subFolders = folder.SubFolders | |
| For Each subFolder in subFolders | |
| GetAllFiles subFolder.Path, resultFiles | |
| Next | |
| End Function |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment