Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Plz help !! microsoft vbscript runtime error input past end of file

Status
Not open for further replies.

arajesha

Technical User
Feb 13, 2015
1
Hi All,
I have mentioned the code, which we use, I am getting the following error in line ""last = lstmsg.ReadLine()"". Kindly help plzz.


if Date > strDate Then
strDate = Date
If Not objFSO.FolderExists("logs") Then
objFSO.CreateFolder("logs")
End If
MsgLogFileName = "logs//" & ComPort & "_" & "msg-" & Year(strDate) & Right("0" & Month(strDate), 2) & Right("0" & Day(strDate), 2) & ".log"
If objFSO.FileExists(MsgLogFileName) Then
Set MsgLogFile = objFSO.OpenTextFile(MsgLogFileName, FOR_APPENDING)
Else
Set MsgLogFile = objFSO.CreateTextFile(MsgLogFileName)
End If
end if

If objFSO.FileExists(lastmsg) Then
Set lstmsg = objFSO.OpenTextFile(lastmsg, FOR_READING)
last = lstmsg.ReadLine()
lstmsg.close
set lstmsg = nothing
cur = now
curr = Hour(cur)*3600 + Minute(cur)*60 + Second(cur)
diff = curr - last
Wscript.echo "diff = " & diff
if (diff > 0 and diff < 40) then
MsgLog("Less than 40 seconds..Time = " & cur )
Wscript.quit
end if
End if
 
Your code is clearly incomplete, and you didn't say what the error is.
 
Is FOR_READING and FOR_APPENDING defined anywhere? They normally have to be explicitly defined in the code.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top