I need to use HTML/VBS to read a TXT file or HTM file
The file names have a DATE in them and are in date order.
examples:
"myfile-07-28-02.txt"
"myfile-07-29-02.txt"
"myfile-07-30-02.txt"
"myfile-07-28-02.htm"
"myfile-07-29-02.htm"
"myfile-07-30-02.htm"
The old way this was done is like this.
The file was replace daily without any history/archive. Keeping the drives mapped to the servers for the various users is, difficult.
The new way copies the files to a folder daily, adding the date stamp to the file name, using the date stamp for history/archival purposes.
The issue is being able to read the "myfile-{date}.txt" in an HTML link.
If I could read the current date from the system, reference that date, find the correct dated file name, and display it. That would be cool. I'm sure this will take some VBS to do I just don't know VBS well enough to be able to do it in HTML.
I'm guessing a function for the date is necessary.
I have one in my code that copies the files.
I address the file name like this
Something like this...
Would be cool but I don't know how to integrate the VBS in to the HTML.
Thanks in advance!
The file names have a DATE in them and are in date order.
examples:
"myfile-07-28-02.txt"
"myfile-07-29-02.txt"
"myfile-07-30-02.txt"
"myfile-07-28-02.htm"
"myfile-07-29-02.htm"
"myfile-07-30-02.htm"
The old way this was done is like this.
Code:
<a href="X:\folder\folder2\myfile.txt" target="dynamic">SiteX</a>
The new way copies the files to a folder daily, adding the date stamp to the file name, using the date stamp for history/archival purposes.
The issue is being able to read the "myfile-{date}.txt" in an HTML link.
If I could read the current date from the system, reference that date, find the correct dated file name, and display it. That would be cool. I'm sure this will take some VBS to do I just don't know VBS well enough to be able to do it in HTML.
I'm guessing a function for the date is necessary.
I have one in my code that copies the files.
Code:
Dim myMonth,myDay,myYear,myDate
myMonth=right("0" & month(now),2)
myDay=right("0" & day(now),2)
myYear=right("0" & year(now),2)
myDate= MyMonth & "-" &myDay & "-" &myYear
ReturnTimeStamp=myPath &"-" & myDate & myExtension
end function
Code:
Set f1 = fso.CreateTextFile (ReturnTimeStamp("C:\folder\Myfile-",".txt"))
f1.close
Set f2 = fso.getfile("\\server\folder\folder\results.txt")
f2.copy (ReturnTimeStamp("C:\folder\Myfile-",".txt"))
Code:
<a href="C:\folder\myfile-{date}.txt" target="dynamic">SiteX</a>
Would be cool but I don't know how to integrate the VBS in to the HTML.
Thanks in advance!