I have a text list of files (about 25k-30k) that are listed using their
absolute path with 1 per line. I wrote a vbscript that takes the list
of files, and one at a time, grab the DateLastModified value from each
one, and if that value is greater or equal to value returned by Date,
then it would right out the DateLastModifed value, a comma, and the
absolute path & filename. Example: 1/23/2008,
c:\somefolder\subfolder\anotherone\textfile.txt. Below is the code I
have written, but it throws an error (Invalid Procedure Call or Argument
800A00005) when accessing the DateLastModified property on the line
FileInfo(temp) = (fso.GetFile(FileToQuery(temp))).DateLastModified
Can anybody tell me where and how I messed up and what I can do to
correct it?
Dim FileName, fso, tempfile, lines, MaxCounter, FileToQuery, FileInfo,
Counter, FileToParse, FileToFind, temp
FileName = "c:\files_modified.txt"
Set fso = CreateObject("Scripting.FileSystemObject")
Set tempFile = fso.getfile(FileName)
with tempFile.openastextstream(1)
.skip tempFile.size
lines = .line
End with
MaxCounter = lines
Dim FileToQuery(MaxCounter), FileInfo(MaxCounter)
Counter = 0
Set FileToParse = fso.OpenTextFile(FileName)
Do Until FileToParse.AtEndOfStream
FileToFind = FileToParse.ReadLine
FileToQuery(Counter) = Trim(FileToFind)
Counter = Counter + 1
Loop
FileToParse.Close
For temp = 0 To MaxCounter - 1
Next
Dim ObjStream
Const TristateFalse = 0
Const FILE_LOCATION = "C:\"
Const FILE_NAME = "updated_files.csv"
set objStream = FSO.CreateTextFile(FILE_LOCATION & FILE_NAME, True,
TristateFalse)
With ObjStream
For temp = 0 To MaxCounter -1