Hello Richard,

These are some very nice routines. However, could you possibly help me and perhaps others by posting a few samples to the board that are a little more clear for usage where you want to get a date difference of a file. Shawn, Bryce, JPOLS and some others already seem to know how to alter this code to their liking... I would like to learn.

i.e. I want to find out if a file is older then a specific period of time. Meaning 10, 30, 60, etc.. days old.

The date format returned by the files are similar to: 2001/05/28 18:00:00 but code that could decipher for YYYY/DD/MM, MM/DD/YYYY etc... would be great.

Bryce and others have come up with these http://kixtart.org/board/Forum2/HTML/000334.html

adamharris posted this (which works), but perhaps yours would be more bullet proof using the Math routines here. http://kixtart.org/board/Forum2/HTML/000133.html

Sample of what I'm looking for an answer for

code:

$common = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders","Common AppData")
$defdate = GetFileTime("$Common\Symantec\Norton AntiVirus Corporate Edition\7.5\I2_LDVP.VDB\VD0D7A02.VDB\naveng32.dll")
$navhome = ReadValue("HKEY_LOCAL_MACHINE\SOFTWARE\INTEL\LANDesk\VirusProtect6\CurrentVersion", "Home Directory")
$filename = "$navhome\vptray.exe"
$datedif = 0
IF (Exist($filename) = 1)
$version = GetFileVersion($filename,"Fileversion")
$size = GetFileSize($filename)
$defdate = GetFileTime($filename)
; ? "$filename version is: "+$version
; ? "$filename size is: "+$size+" Bytes"
; ? "Virus definition date is: $defdate"

$datedif = (todays date - $defdate)

IF $datedif > 30
; take some action
ELSE
; no action required
ENDIF


TIA for any and all assistance and training from those more learned in the art...


------------------
NTDOC...
The dark side is quicker, easier, more seductive.
If you choose the quick and easy path, you will become an agent of evil.

[This message has been edited by NTDOC (edited 07 June 2001).]