批处理文件来删除文件夹在Windows 7早于10天 [英] Batch file to delete folders older than 10 days in Windows 7

查看:118
本文介绍了批处理文件来删除文件夹在Windows 7早于10天的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我要创建哪些应该删除这是年龄超过10天的文件夹的所有子文件夹的批处理文件,使用Windows 7

I want to create a batch file which should delete all subfolders of a folder which are older than 10 days, using Windows 7

任何帮助将是AP preciated。

Any help would be appreciated.

推荐答案

从<一个改编href=\"http://stackoverflow.com/questions/3419091/delete-sub-directories-older-than-30-days/3419357#3419357\">this回答一个非常类似的问题:

FORFILES /S /D -10 /C "cmd /c IF @isdir == TRUE rd /S /Q @path"

您应该运行从 D内的这个命令:\\学习文件夹中。它会删除这是超过10天的所有子文件夹。

You should run this command from within your d:\study folder. It will delete all subfolders which are older than 10 days.

/ S / Q RD 使得它删除文件夹,即使他们不为空,而不提示

The /S /Q after the rd makes it delete folders even if they are not empty, without prompting.

我建议你把上面的命令到一个.bat文件,并将其保存为 D:\\学习\\ cleanup.bat

I suggest you put the above command into a .bat file, and save it as d:\study\cleanup.bat.

这篇关于批处理文件来删除文件夹在Windows 7早于10天的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆