Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/windows/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Windows 自动删除包含';30天内没有访问过_Windows_File_Batch File_Delete File - Fatal编程技术网

Windows 自动删除包含';30天内没有访问过

Windows 自动删除包含';30天内没有访问过,windows,file,batch-file,delete-file,Windows,File,Batch File,Delete File,我有一个批处理文件,我正在尝试删除特定位置中30天未被访问的文件。它目前删除了30多天前创建的文件,这不是我想要的 我的代码是: REM Remove files older than 30 days forfiles /p "DOCUMENT LOCATION" /s /m *.* /c "cmd /c Del @path" /d -30 任何帮助都将不胜感激!如果可能的话,我想这是一个快速解决方案 谢谢 最后一个访问时间戳不可靠。可以通过各种路径访问文件,但时间戳不会更新。自行承担风险

我有一个批处理文件,我正在尝试删除特定位置中30天未被访问的文件。它目前删除了30多天前创建的文件,这不是我想要的

我的代码是:

 REM Remove files older than 30 days
forfiles /p "DOCUMENT LOCATION" /s /m *.* /c "cmd /c Del @path" 
/d -30
任何帮助都将不胜感激!如果可能的话,我想这是一个快速解决方案


谢谢

最后一个访问时间戳不可靠。可以通过各种路径访问文件,但时间戳不会更新。自行承担风险。是否有办法使修改后的日期过期?默认情况下,Windows不再更新“上次访问”时间戳。您首先需要打开该功能,或者使用更可靠的功能,如安全审计。即使这样,我也不认为从批处理中使用它很容易。最后的访问时间戳不可靠。可以通过各种路径访问文件,但时间戳不会更新。自行承担风险。是否有办法使修改后的日期过期?默认情况下,Windows不再更新“上次访问”时间戳。您首先需要打开该功能,或者使用更可靠的功能,如安全审计。即使这样,我也不认为它很容易批量使用。