myniguez,
Add this code to check for last day of month
If LDOM(date) then
newfile.writeline "Here is end-of-month line 2"
newfile.writeline "Here is end-of-month line 3"
Else
newfile.writeline "Here is line 2"
newfile.writeline "Here is line 3"
End If
' Add this code to the bottom of your vbscript.
' ***********************
Function LDOM(tmpDate)
' ***********************
'
' Returns TRUE if tmpDate is last day of the month
' Date formats: 23/2/2000 or 23-February-2000
Dim months, Lastday
strMonths = "January,February,March,April,May,June,July,August,September,October,November,December"
months = split(strMonths, ","
strLastDays = "31,28,31,30,31,30,31,31,30,31,30,31"
Lastday = split(strLastDays, ","

'
' First get the day, month, and year from the given date
mm = Month(tmpDate)
dd = Day(tmpDate)
yy = Year(tmpDate)
'
' Get the last day of the month for this year
' First, determine if this is a leap year
If LeapYearCheck(yy) then
LastDay(1) = 29
Else
LastDay(1) = 28
End if
'
If int( Lastday(mm-1) ) = int(dd) then
LDOM = True
Else
LDOM = False
End IF
End Function
' ******************************
Function LeapYearCheck(testyear)
' ******************************
' Years not evenly divisible by 4 are not leap years
' OR
' Years evenly divisible by 100 but not evenly divisible by 400 are not leap years
If (testyear mod 4) <> 0 or ( (testyear mod 100 = 0) and (testyear mod 400 <> 0) ) then
leapyearCheck = False
Else
leapyearCheck = True
End If
End Function
fengshui_1998