I'm trying to get the last line in a .HOL file. It will get the last line but every time you run the script, it stacks the previous lines.
Dim lastLine
Dim objFile
Dim objFSO
Const ForReading = 1
Set objFSO = CreateObject("Scripting.FileSystemObject")
Set objFile = objFSO.OpenTextFile("C:\Desktop\OUTLOOK.HOL", ForReading)
Do Until objFile.AtEndOfStream
lastLine = objFile.ReadLine
Loop
objFile.Close
Wscript.Echo lastLine
What I'm trying to make is a script that gets rid of any date that is older than the current date then add a new date at the bottom of the .HOL file. The reason I need the last line is so I can take that date and add 2 weeks to it.
What the Echo Looks like Run 1 Run 2
Date1 Date1
Date2
Run 3
Date1
Date2
Date3
And so forth if you get it. (Id post picture but I cant yet)
=========== .HOL File =======
[Test Days] 5
Test Day, 5/3/2013
Test Day, 5/17/2013
Test Day, 5/31/2013
Test Day, 6/14/2013
Test Day, 6/28/2013