Set new Create DateTime for selected items

I would like to set the create date/time for selected items in a descending way. i would take the current create from the first file and then set a new create for each file, substracting 1 second for each file.
i tried this, but i just cannot get it running:

Option Explicit
Function OnClick(ByRef clickData)


	Dim cmd, lister, tab, selItem, folderEnum, folderItem, timestamp
	' ---------------------------------------------------------
	for each selItem in clickdata.func.sourcetab.selected

		if timestamp = "" then 
			dopus.output "no time"
			timestamp = selItem.create
		end if

		dopus.output selItem.attr_text & " " & selitem.create

		selItem.create = timestamp.sub(1,"S")
	
	next



End Function

someone any idea?
many thanks
david

Those properties are read-only. To change the timestamp of a file, you could run the SetAttr command (via the Command object you're given inside the clickData arg).

(Using the Windows Scripting Host objects/methods is another possibility.)

A solution for a similar problem can be found here:

1 Like

Many thanks. This just did the trick.
Regards
David