I am getting this error:
\"C:\\se2.vbs(28, 6) Microsoft VBScript runtime error: Input past end of file\"
when I run my script (I italicized LINE
Looks like one of the files has zero size. Evidence:
Option Explicit
Const ForReading = 1
Dim goFS : Set goFS = CreateObject("Scripting.FileSystemObject")
Dim oFile
For Each oFile In goFS.GetFolder("..\data\26878933").Files
WScript.Echo oFile.Path, oFile.Size
WScript.Echo oFile.OpenAsTextStream(ForReading).ReadAll()
WScript.Echo "------"
Next
output:
cscript 26878933.vbs
..\data\26878933\a.txt 3
a
------
..\data\26878933\b.txt 0
26878933.vbs(10, 5) Microsoft VBScript runtime error: Input past end of file
I found out the problem. The error occurred when the script searched for a string in a BLANK TEXT FILE. I tried adding this:
IF oFSO.GetFile(path).size <> 0 then
'Process text file then search for string.
END IF