Here is an example of reading the date from the .ini file and acting on it.
Give this a try and let us know how it goes please.

Example Output

  • Applications script last ran on 2005/03/05 which was 25 days ago
    It is now time to run the Applications script again

    The Hardware script does not need to be run at this time.

    Security script last ran on 2005/03/15 which was 15 days ago
    It is now time to run the Security script again

    Software script last ran on 2005/03/08 which was 22 days ago
    It is now time to run the Software script again


Here is the contents of the test file lastrun.ini

[scripts]
Applications=2005/03/05
Hardware=2005/03/25
Security=2005/03/15
Software=2005/03/08



Break On
Dim $SO,$Pause
$SO=SetOption('Explicit','On')
$SO=SetOption('NoVarsInStrings','On')
$SO=SetOption('WrapAtEOL','On')


Dim $Applications, $Hardware, $Security, $Software
Dim $LastRunApplications, $LastRunHardware, $LastRunSecurity, $LastRunSoftware
$Applications = ReadProfileString (@ScriptDir+'\'+'lastrun.ini', 'scripts', 'Applications')
$Hardware = ReadProfileString (@ScriptDir+'\'+'lastrun.ini', 'scripts', 'Hardware')
$Security = ReadProfileString (@ScriptDir+'\'+'lastrun.ini', 'scripts', 'Security')
$Software = ReadProfileString (@ScriptDir+'\'+'lastrun.ini', 'scripts', 'Software')


$LastRunApplications = DateCalc(@DATE,$Applications)
$LastRunHardware = DateCalc(@DATE,$Hardware)
$LastRunSecurity = DateCalc(@DATE,$Security)
$LastRunSoftware = DateCalc(@DATE,$Software)


If $LastRunApplications > 7
? 'Applications script last ran on '+$Applications+' which was '+$LastRunApplications+' days ago'
? 'It is now time to run the Applications script again' ?
; Run the applications script and update the lastrun.ini
Else
? 'The applications script does not need to be run at this time.' ?
EndIf


If $LastRunHardware > 7
? 'Hardware script last ran on '+$hardware+' which was '+$LastRunhardware+' days ago'
? 'It is now time to run the Hardware script again' ?
; Run the applications script and update the lastrun.ini
Else
? 'The Hardware script does not need to be run at this time.' ?
EndIf


If $LastRunSecurity > 7
? 'Security script last ran on '+$security+' which was '+$LastRunSecurity+' days ago'
? 'It is now time to run the Security script again' ?
; Run the security script and update the lastrun.ini
Else
? 'The Security script does not need to be run at this time.' ?
EndIf


If $LastRunsoftware > 7
? 'Software script last ran on '+$software+' which was '+$LastRunSoftware+' days ago'
? 'It is now time to run the Software script again' ?
; Run the Software script and update the lastrun.ini
Else
? 'The Software script does not need to be run at this time.' ?
EndIf


Function DateCalc($date1, $DateOrMod, optional $SingleDigit)
Dim $_intDate1, $_intYear1, $_intMonth1, $_intDay1
Dim $_intDate2, $_intYear2, $_intMonth2, $_intDay2
$date1 = Split($date1,'/')
If UBound($date1) <> 2
Exit 1
EndIf
$_intYear1 = Val($date1[0])
$_intMonth1 = Val($date1[1])
$_intDay1 = Val($date1[2])
If $_intMonth1 < 3
$_intMonth1 = $_intMonth1 + 12
$_intYear1 = $_intYear1 - 1
EndIf
$_intDate1 = $_intDay1 + ( 153 * $_intMonth1 - 457 ) / 5 + 365 * $_intYear1 +
$_intYear1 / 4 - $_intYear1 / 100 + $_intYear1 / 400 - 306
Select
Case VarType($DateOrMod) = 3
$_intDate2 = $_intDate1 + $DateOrMod
If InStr($_intDate2,'-') $_intDate2 = Val(SubStr($_intDate2,2,len($_intDate2)-1)) EndIf
$_intYear2 = ( 100 * ( ( ( 100*($_intDate2+306)-25)/3652425)
- ( ((100*($_intDate2+306)-25)/3652425)/4)
) + (100*($_intDate2+306)-25)
) / 36525
$_intMonth2 = ( 5 * ( ( ( 100*($_intDate2+306)-25)/3652425)
- ( ((100*($_intDate2+306)-25)/3652425)/4)
+ ($_intDate2+306) - 365 * $_intYear2 - $_intYear2 / 4
) + 456
) / 153
$_intDay2 = ( ( ( 100*($_intDate2+306)-25)/3652425)
- ( ((100*($_intDate2+306)-25)/3652425)/4)
+ ($_intDate2+306) - 365 * $_intYear2 - $_intYear2 / 4
) - ( 153 * $_intMonth2 - 457
) / 5
If $_intMonth2 > 12 $_intYear2 = $_intYear2 + 1 $_intMonth2 = $_intMonth2 - 12 EndIf
If Not $SingleDigit
If Len($_intYear2 ) < 4
$_ = Execute("for $i=1 to 4-Len($$_intYear2) $$_intYear2 = '0' + $$_intYear2
next"
)
EndIf
$_intMonth2 = Right("0" + $_intMonth2,2)
$_intDay2 = Right("0" + $_intDay2,2)
EndIf
$DateCalc = ''+$_intYear2+'/'+$_intMonth2+'/'+$_intDay2
Case VarType($DateOrMod) = 8
$DateOrMod = Split($DateOrMod,'/')
If UBound($DateOrMod) <> 2
Exit 1
EndIf
$_intYear2 = Val($DateOrMod[0])
$_intMonth2 = Val($DateOrMod[1])
$_intDay2 = Val($DateOrMod[2])
If $_intMonth2 < 3
$_intMonth2 = $_intMonth2 + 12
$_intYear2 = $_intYear2 - 1
EndIf
$_intDate2 = $_intDay2 + ( 153 * $_intMonth2 - 457 ) / 5 + 365 * $_intYear2 +
$_intYear2 / 4 - $_intYear2 / 100 + $_intYear2 / 400 - 306
$DateCalc = $_intDate1 - $_intDate2
;comment the next line If you wish to return negative results also !!!
If InStr($DateCalc,'-') $DateCalc = Val(SubStr($DateCalc,2,Len($DateCalc)-1)) EndIf
Case 1
Exit 1
EndSelect
EndFunction