该脚本基本上会转到一个文件夹并列出该文件夹中的所有文件并将其输出为 txt 文件。现在,我不想定义文件夹路径,而是希望它使用其中包含一堆文件夹路径的 txt 文件,并且我想循环该 txt 文件。我怎样才能做到这一点?
Dim fso
Dim ObjFolder
Dim ObjOutFile
Dim ObjFiles
Dim ObjFile
'Creating File System Object
Set fso = CreateObject("Scripting.FileSystemObject")
'Getting the Folder Object
Set ObjFolder = fso.GetFolder("C:\Users\Susan\Desktop\Anime\ova")
'Creating an Output File to write the File Names
Set ObjOutFile = fso.CreateTextFile("C:\Users\Susan\Documents\iMacros\Macros\WindowsFiles.txt")
'Getting the list of Files
Set ObjFiles = ObjFolder.Files
'Writing Name and Path of each File to Output File
For Each ObjFile In ObjFiles
ObjOutFile.WriteLine(ObjFile.Path)
Next
ObjOutFile.Close