Created
August 13, 2014 15:47
-
-
Save selfish/1aa974af0a0c80a4c27d to your computer and use it in GitHub Desktop.
VBS Lookup files in folders. (Execute: cscript lookupXML.vbs)
This file contains 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
On Error Resume Next | |
Dim fso, StdOut, folders, files, ext | |
folders = Array(_ | |
"c:\",_ | |
"c:\users"_ | |
) | |
ext = ".xml" | |
Set fso = CreateObject("Scripting.FileSystemObject") | |
Set StdOut = fso.GetStandardStream (1) | |
StdOut.WriteLine "" | |
StdOut.WriteLine "" | |
StdOut.WriteLine "** Testing for XMLs:" | |
StdOut.WriteLine "" | |
StdOut.WriteLine "" | |
For each sFolder In folders | |
Set files = fso.GetFolder(sFolder).Files | |
For each folderIdx In files | |
If InStr(folderIdx.name, ".xml") > 0 Then | |
StdOut.WriteLine " > " + ext + " found in " + sFolder | |
End If | |
Next | |
Next | |
StdOut.WriteLine "" | |
StdOut.WriteLine "" | |
StdOut.WriteLine "** Tested all Dirs." | |
Wscript.Quit |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment