Avatar of tonelm54
tonelm54
 asked on

Modify file details

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?
VB Script

Avatar of undefined
Last Comment
Bill Prew

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
Bill Prew

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Experts Exchange has (a) saved my job multiple times, (b) saved me hours, days, and even weeks of work, and often (c) makes me look like a superhero! This place is MAGIC!
Walt Forbes