批处理文件来删除文件夹在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.
答
从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
.