Microsoft VBScript runtime error: Input past end of file error

前端 未结 2 1563
心在旅途
心在旅途 2021-01-27 09:21

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

2条回答
  •  忘了有多久
    2021-01-27 09:27

    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
    

提交回复
热议问题