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

I am William McGill, a dedicated professional with a diverse background in information technology, communications, and innovation. For over 20 years, I have honed my skills to serve businesses and individuals, leveraging the latest technology trends to solve complex problems and enhance lives. As an effective communicator, I excel at conveying intricate information to diverse audiences, bridging the gap between technology and business. My commitment extends beyond professional expertise; I believe in continual learning, acts of kindness, and contributing meaningfully to society. I'm passionate about making a positive difference and look forward to collaborating with you to meet your needs. Welcome to my website, where technology, compassion, and the desire to contribute to the greater good converge.

Leave a comment

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

William McGill