Changing File Creation & Modification Dates with Powershell in Windows

Changing file creation and modification dates using Powershell in Windows.

Open powershell (c:\Windows\system32\Windowspowershell\v1.0\powershell.exe)

Change to directory containing files needing modification using (chdir) command and issue the following commands for each file that you’re needing to change:

$(Get-Item 'file-name-including-extenstion').creationtime=$(Get-Date "mm/dd/yyyy hh:mm:ss pm")
$(Get-Item 'file-name-including-extenstion').lastwritetime=$(Get-Date "mm/dd/yyyy hh:mm:ss pm")

And if neccessary, change last access time:

$(Get-Item 'file-name-including-extenstion').lastaccesstime=$(Get-Date "mm/dd/yyyy hh:mm:ss pm")

By William McGill

Like many people, I believe I’m here to make a positive difference in the lives of those around me, and thus the world. Through continual learning and meeting people from both near and far, I continue evolving into an adept person capable of and endeavoring to give back in beneficial and meaningful ways.

Leave a comment

Your email address will not be published. Required fields are marked *

William McGill