×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

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

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

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

(OP)
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

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

Your code is clearly incomplete, and you didn't say what the error is.

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

Is FOR_READING and FOR_APPENDING defined anywhere? They normally have to be explicitly defined in the code.

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close