Well with the help of Mr_Jooel and some UDF power, here is an example of doing this.
You can get the UDFs from the board, but I'll post the full thing here to make it easier to copy and test.
Code:
Break On
Dim $SO
$SO=SetOption('Explicit','On')
Dim $HKLMAppPaths,$sFile,$LADate,$TimeDiff
$HKLMAppPaths='HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths'
$sFile=Trim(ReadValue($HKLMAppPaths + '\powerpnt.exe',''))
$LADate=Split(Trim(Join(Split(fnGetFileProp($sFile,DateLastAccessed),""),"",1)),"/")
$LADate=$LADate[2]+"/"+Right("0"+$LADate[0],2)+"/"+Right("0"+$LADate[1],2)
$TimeDiff=DateCalc(@DATE,$LADate)
If $TimeDiff > 0 ; change to date you want to test
'The file ' + $sFile + ' has not been accessed in over ' + $TimeDiff + ' days.' ?
'The file ' + $sFile + ' Last Accessed: ' + $LADate + Right(fnGetFileProp($sFile,DateLastAccessed),-9) ?
EndIf
Function fnGetFileProp($sFile,$sProp)
Dim $objFSO, $objFile, $nul
$objFSO = CreateObject("Scripting.FileSystemObject")
If Not VarType($objFSO)=9 Exit 1 EndIf
$objFile = $objFSO.GetFile($sFile)
If Not VarType($objFile)=9 Exit 2 EndIf
$nul=Execute("$$fnGetFileProp = $$objFile."+$sProp)
If VarType($fnGetFileProp)=0 Exit 87 EndIf
EndFunction
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