删除主文件夹中超过30天的子文件夹 [英] Deleting subfolders older than 30 days in the main Folder

查看:252
本文介绍了删除主文件夹中超过30天的子文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的专家,请帮助我。一个vba代码,可以删除主文件夹中超过30天的子文件夹。我对vba没有太多经验。请帮我。


谢谢

解决方案

@Hishow:

欢迎来到Bytes.com

你不能要求直接代码作为解决方案。

我们来这里询问怎么做 - 不是你这样做的人==


删除你可以使用的vba文件夹:

展开 | 选择 | Wrap | 行号


答案很好,但我相信 Kill()将失败用于任何不空的文件夹。


我认为rondebruin在这个链接中有更好的例子
删除文件和文件夹

来自该链接的此代码副本清除主文件夹中的所有内容无条件> = 30天

展开 | 选择 | Wrap | 行号


Dear Experts, please I need help. A vba codes that can delete subfolders older than 30 days in the main Folder. I do not have much experience on vba. Please help me.

Thank you

解决方案

@Hishow:
welcome to Bytes.com
you can''t call for the directly code as solution.
we come here to ask how to do that -- not how you guy do that ==

to delete folders in vba you can use:

Expand|Select|Wrap|Line Numbers


Good answer, but I believe Kill() will fail if used on any folder that isn''t empty.


I think rondebruin have better example here in this link
Delete files and folders
this code copy from that link that clear everything in main folder without condition >=30 days

Expand|Select|Wrap|Line Numbers


这篇关于删除主文件夹中超过30天的子文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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