Modify the creation time and modification time of files and folders

Use the Windows PowerShell tool to modify
the way Win7 opens PowerShell: Start, All Programs, Accessories, Windows PowerShell
Note that if you modify the files in the system directory, you need to open PowerShell with administrator privileges

View file properties

Get-ItemProperty 文件名 | Format-list -Property * -Force

You can see several properties of the file
insert image description here

Modified file time

$(Get-Item 文件名).creationtime=$(Get-Date "mm/dd/yyyy")

After modification, view the file through the Get-ItemProperty command, and you can see that the CreateionTime has changed
insert image description here

reference

https://www.webnots.com/how-to-change-date-attributes-of-files-and-folders-in-windows-10

Guess you like

Origin blog.csdn.net/tangyin025/article/details/128764302