Abraham
Abraham

Reputation: 31

Change modification time stamp with vbscript

i need to change modification time stamp in windows files with vbscrip after copying them. Thanks

Upvotes: 1

Views: 9317

Answers (2)

Konrad
Konrad

Reputation: 1014

You can do it by setting the FolderItem.ModifyDate property. Everything is described here. Sample code:

Set objShell = CreateObject("Shell.Application")

Set objFolder = objShell.NameSpace("C:\Scripts")
Set objFolderItem = objFolder.ParseName("File.jpg")

objFolderItem.ModifyDate = "01/01/2008 8:00:00 AM"

Upvotes: 9

Ekkehard.Horner
Ekkehard.Horner

Reputation: 38745

According to the the docs

DateLastModified

Property Returns the date and time that the specified file or folder was last modified. Read-only.

the property is read-only.

Upvotes: -1

Related Questions