我知道如何分配的当前时间和日期使用文件copy /b filename.ext +,,
,但我怎么能为它分配一个不同的时间和日期,在这个变量:set DateTime=01/01/1970 03:00 AM
?
这不能在Windows CMD中本地完成。
您可以使用NirSoft的NirCmd(在他的网站http://www.nirsoft.net/utils/nircmd.html上免费下载),其命令如下:
nircmd.exe setfiletime "c:\temp\myfile.txt" "24-11-2015 17:57:11" "22-11-2005 10:21:56"
另一种选择是在PowerShell中执行此操作,如答案“如何更改文件的时间戳? ”所示,使用以下命令:
$(Get-Item c:\temp\myfile.txt).creationtime=$(Get-Date "11/24/2015 5:57 PM")
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句