This UDF will modify the timestamp. There are a couple of caveats:
  • If the file doesn't exist you won't get an error.
  • For some reason relative paths seem to give the Shell.Namespace() method a problem, so use absolute paths for the file name


I'll leave these issues as an exercise for you to fix up.

In this example the modify timestamp on local file testfile.kix is set to the current time.

 Code:
Break ON
$=SetOption("Explicit","ON")

Dim $sFile
$sFile="testfile.txt"

$=SetFileTime($sFile,@DATE+" "+@TIME)
If @ERROR "Error setting time: ["+@ERROR+"] "+@SERROR+@CRLF EndIf

Function SetFileTime($sPath,$sDateTime)
	Dim $sDir,$sFile
	Dim $oShell,$oFolder

	$sFile=SubStr($sPath,InStrRev($sPath,"\")+1)
	If $sFile=$sPath
		$sDir=@CURDIR
	Else
		$sDir=Left($sPath,InStrRev($sPath,"\"))
	EndIf

	$oShell=CreateObject("Shell.Application")
	If @ERROR Exit @ERROR EndIf
	$oFolder=$oShell.NameSpace($sDir)
	If @ERROR Exit @ERROR EndIf
	$oFolder.Items.Item($sFile).ModifyDate=$sDateTime
	If @ERROR Exit @ERROR EndIf

	Exit 0
EndFunction