We help IT Professionals succeed at work.

Modify file details

tonelm54
tonelm54 asked
on
116 Views
Last Modified: 2017-03-09
I'm trying to build a sub to modify the details of a file (lastModifiedTime, lastWriteTime, lastAccessedTime, createdTime), so I have been trying to build the following:-
	Sub setFileDateTime(strFolder, strFile, lastModifiedTime, lastWriteTime, lastAccessedTime, createdTime)
		Set objShell = CreateObject("Shell.Application")
		Set objFolder = objShell.NameSpace(strFolder)
		Set objFolderItem = objFolder.ParseName(strFile)
		
		objFolderItem.ModifyDate = lastModifiedTime
	End Sub

Open in new window


However I cannot find out how to access  lastWriteTime, lastAccessedTime, createdTime properties.

Any ideas?
Comment
Watch Question

Test your restores, not your backups...
CERTIFIED EXPERT
Expert of the Year 2019
Top Expert 2016
Commented:
This problem has been solved!
(Unlock this solution with a 7-day Free Trial)
UNLOCK SOLUTION