Created
July 14, 2010 16:51
-
-
Save JoshMock/475670 to your computer and use it in GitHub Desktop.
Prints a list of file names in a given folder to a text file.
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
' Results: Prints a list of file names in FOLDER_TO_CHECK to the text file at OUTPUT_FILE_LOCATION | |
Dim FOLDER_TO_CHECK | |
FOLDER_TO_CHECK = "C:\Folder\to\list\" | |
OUTPUT_FILE_LOCATION = "C:\Temp\ListFileNames.txt" | |
Dim fs, logFile, folder | |
Set fs = CreateObject("Scripting.FileSystemObject") | |
Set logFile = fs.OpenTextFile(OUTPUT_FILE_LOCATION, 2) | |
Set folder = fs.GetFolder(FOLDER_TO_CHECK) | |
For Each file In folder.Files | |
logFile.WriteLine file.Name | |
Next | |
logFile.Close | |
Set folder = Nothing | |
Set logFile = Nothing | |
Set fs = Nothing |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment