Change file/folder creation time using Powershell
By Ramu Soft
Do you want to change a file/folder creation time? It is very easy with powershell, check out this code.
For example, if you want to change the file creation time to "01/10/2008 1:00", use below code.
PS:C:\>Get-ChildItem c:\temp\myfile.txt | % { $_.CreationTime = '01/10/2025 1:00' }
Now check the file creation time using below command
PS:C:\>Get-ChildItem c:\temp\myfile.txt | select creationtime
In case if you want to do this for all files inside a folder, then try below.
PS:C:\>Get-ChildItem c:\temp\ | % {$_.CreationTime = '01/10/2025 1:00'}
Hope this helps.
Change file/folder creation time using Powershell (7765 Views)