返回列表 发帖
本帖最后由 Nsqs 于 2017-8-8 19:21 编辑

回复 18# Batcher
删除文件
  1. PowerShell -c "Dir -File|ForEach{If(((Get-Date)-$_.LastWriteTime).Days -gt 30){Remove-Item $_.FullName}}"
复制代码
删除文件夹
  1. PowerShell -c "Dir -Dir|ForEach{If(((Get-Date)-$_.LastWriteTime).Days -gt 30){Remove-Item $_.FullName}}"
复制代码
一行流,当前文件夹内删除30天前的文件

09年的帖子,方法太老了,嵌套VBS怎么写的这么复杂,请参见复制7天前的文件

TOP

返回列表