Will,
I think you're missing some code. There's nothing that compares for the newest.
I have a similar need for NAV. THe difference is the revision number is in hex otherwise the basic logic is the same. I do a value compare rather than a date compare is there can be several releases in one day.
code:
$TempDir ="C:\Test\Temp" ; ###change to where your's will go###
$WorkDir ="C:\Test" ; ###change to where your's will go###
$VPHome ="C:\Test\NAV" ; ###change to where your NAV parent's .vdb files exist###
$Name = Dir($VPHome + "\*.vdb")
$Newest = $Name
While $Name <> "" and @ERROR = 0
If Not (GetFileAttr($VPHome + $name) & 16) ; sanity check - should not be a folder
If Val("&"+SubStr($Newest,3,6)) < Val("&"+SubStr($Name,3,6))
$Newest=$Name
EndIf
EndIf
$Name = Dir()
Loop
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.