Voilą, this works:
Code:
;ModifyFileDate - Modify a file date and time.
Function ModifyFileDate($file, Optional $date)
;http://msdn.microsoft.com/library/default.asp?url=/library/en-us/shellcc/platform/shell/reference/objects/folderitem/modifydate.asp
;Quick and dirty function, the $date format depends on the local settings,
;but this works when we need to re-apply the same date after having modified a file.
Dim $object, $file_path, $file_name, $object_path, $folder_item
$file_path = SubStr($file, 1, InStrRev($file, "\") - 1)
$file_name = SubStr($file, InStrRev($file, "\") + 1)
$object = CreateObject("Shell.Application")
$object_path = $object.NameSpace($file_path)
If $object_path <> ""
$folder_item = $object_path.ParseName($file_name)
If $folder_item <> ""
$ModifyFileDate = $folder_item.ModifyDate
If IsDeclared($date)
$folder_item.ModifyDate = $date
EndIf
EndIf
EndIf
EndFunction
I'm too lazy to put it in the UDF section...