我如何更改(最好批量)文件的创建、最后修改和最后访问时间?
答案1
答案2
在 PowerShell 中,类似以下内容:
$date = Get-Date "2010-01-31 10:11:12"
Get-ChildItem *.foo | Foreach-Item {
$_.LastWriteTime = $date
$_.LastAccessTime = $date
}
答案3
接管指挥控制台 LE(TCC LE)是命令提示符的免费替代品,具有touch
可以更改文件创建、最后修改和最后访问时间和日期的命令。当然,它也可以运行批处理文件。
要使用的参数是 /D(表示日期)和 /T(表示时间):
/D
On an LFN drive, you can specify which of the date fields should be set by appending a, c, or w to the /D option:
a Last access date
c Creation date
w Last modification (write) date
/T
On an LFN drive, you can specify which of the time fields should be set by appending a, c, or w to the /T option:
a Last access time (on VFAT volumes access time is always midnight).
c Creation time
w Last modification (write) time
答案4
SK时间戳外壳扩展。