如何按计划自动删除下载文件夹中的文件

Delete 0

Whether you share your computer with other people or you use it for a lot of downloads, it is nice to be able to clear out the download folder without having to manually take care of it each week or month, which is when an automated deletion comes in handy.

无论您是与他人共享计算机还是要进行大量下载,都可以清除下载文件夹,而不必每周或每月手动进行处理,这是很好的选择,这是在自动删除功能出现时派上用场。

You can automate the cleanup of your download folder using a batch file that will delete files older than a certain amount of days. You can run this whenever you feel that you need to clean up your download folder or you can use the Task Scheduler to run it daily, weekly, monthly, etc.

您可以使用批处理文件自动清理下载文件夹,该批处理文件将删除超过一定天数的文件。 您可以在需要清理下载文件夹时运行它,也可以使用任务计划程序每天,每周,每月等运行它。

创建您的批处理文件 (Create Your Batch File)

For this example, we will tell the batch file to delete any files that are located in the download folder that are older than 30 days. This is useful if you do things like Photoshop work, or writing where you download a lot of resources that you don’t need after an extended period of time.

对于此示例,我们将告诉批处理文件删除下载文件夹中超过30天的所有文件。 如果您执行诸如Photoshop工作之类的事情,或者在较长的一段时间内编写下载大量不需要的资源的位置时,此功能将非常有用。

The first step will be to open notepad. Once you have the program open, paste this string into the screen.

第一步将打开记事本。 打开程序后,将此字符串粘贴到屏幕中。

REM Remove files older than 30 days
forfiles /p "C:\Users\YOURUSERNAME\Downloads" /s /m *.* /c "cmd /c Del @path" /d -30
REM Remove files older than 30 days
forfiles /p "C:\Users\YOURUSERNAME\Downloads" /s /m *.* /c "cmd /c Del @path" /d -30
射击1

Remember to change the directory to match your computer. You can also choose any directory that is on your computer for the target. Once you have entered the string, save the document as a batch file.

切记更改目录以匹配您的计算机。 您也可以为目标选择计算机上的任何目录。 输入字符串后,将文档另存为批处理文件。

射击2

Simply run the file to make sure it works and you will see that any files in your download folder are automatically sent to your Recycle Bin if they are older than 30 days.

只需运行文件以确保其工作,并且如果超过30天,下载文件夹中的任何文件都会自动发送到回收站。

创建计划任务 (Create a Scheduled Task)

For the purpose of this example, we will schedule the automatic file deletion every seven days. Begin by opening the start menu and typing in “Task Scheduler” then running the application.

就本示例而言,我们将每7天安排一次自动文件删除。 首先打开开始菜单,然后输入“ Task Scheduler ”,然后运行该应用程序。

Alternatively, you can open your “Control Panel.” Under the “System and Security” section select the “Administrative Tools” option and then run the “Task Scheduler.”

或者,您可以打开“控制面板”。 在“系统和安全性”部分下,选择“管理工具”选项,然后运行“任务计划程序”。

Once you have the program open, click on the “Action” drop-down menu and select “Create Basic Task.”

打开程序后,单击“操作”下拉菜单,然后选择“创建基本任务”。

射击3

You can give the task a name and description of your choosing. For this example, we will call it “Weekly Download Cleanup” and leave the description empty since the title is self-explanatory; then click “Next.”

您可以为任务选择名称和描述。 在此示例中,我们将其称为“每周下载清理”,并将描述保留为空,因为标题是不言自明的。 然后点击“下一步”。

射击4

From the “Trigger” section, we will choose to make the task a weekly action followed by pressing “Next.”

在“触发器”部分,我们将选择每周执行一次任务,然后按“下一步”。

射击5

Now you will need to select a time and day. Remember to choose a time and day that your computer is powered on. For this example, we will just choose midnight on Friday then click next.

现在,您将需要选择时间和日期。 切记选择打开计算机电源的时间和日期。 对于此示例,我们只选择星期五的午夜,然后单击下一步。

射击6

Now you will see the “Action” screen. We will leave this as is, since we want to run a specific program every Friday; so you can just click “Next.”

现在,您将看到“操作”屏幕。 因为我们要在每个星期五运行一个特定的程序,所以我们将其保持不变。 因此您只需单击“下一步”。

射击7

Now you will just need to click on “Browse” and select the batch file you created. As you can see, our batch file was saved on the desktop and is called “DownloadCleanup.bat.” Once you have done that, just click “Next.”

现在,您只需要单击“浏览”并选择您创建的批处理文件。 如您所见,我们的批处理文件保存在桌面上,称为“ DownloadCleanup.bat”。 完成此操作后,只需单击“下一步”。

射击8

The last screen you will see gives you a comprehensive overview of the task you created. Once you verify that everything is right, just click “Finish” to complete the task creation and it will run automatically according to your specifications.

您将看到的最后一个屏幕为您提供了所创建任务的全面概述。 确认一切正确后,只需单击“完成”以完成任务创建,它将根据您的要求自动运行。

射击9

Now that you know how to schedule auto-deletion of your old files, you don’t need to worry about how to clear up any old files from your download folder.

现在,您知道如何安排自动删除旧文件了,您无需担心如何从下载文件夹中清除所有旧文件。

Image Credit: Mixy Lorenzo on Flickr

图片来源: Flickr上的Mixy Lorenzo

翻译自: https://www.howtogeek.com/201930/how-to-automatically-delete-files-in-your-download-folder-on-a-schedule/

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Dr. Folder 是一款界面友好、功能强大、简单易用的文件夹美化工具,只需简单的点击几次,即可快速地更改任意文件夹的标准图标,使其变成生动活泼、令人羡慕的漂亮文件夹! 优点: - 组织有序 - 使用“优先级”图标确定任务的优先级或指示流程进度 - 节省查找文件的时间 - 只需点击一下即可将文件夹整理好 - 保护有价值的信息免遭意外删除 - 高亮显示不能删除的重要文件夹 - 个性化您的工作区 - 使您的文件夹与其他文件夹不同,在一台计算机或局域网上与其他用户共享 主要特点: - Dr. Folder 可更改网络文件夹的图标,所以您可自定义你的局域网 - Dr. Folder 包含在办公室工作时的其他图标 - Dr. Folder 允许您以最简单的方式更改文件夹图标(只需点击一下鼠标) - Dr. Folder 还有两个用于更改文件夹图标的选项:“使自定义文件夹可分发”(便携式)和“将选择图标应用于所有子文件夹” - Dr. Folder 可按优先级(高、正常、低)、工作完成度(完成、半完成、计划)、工作状态(批准、拒绝、待定)以及包含的信息类型标记文件夹(工作文件、重要文件、临时文件、私人文件)。 - Dr. Folder 可将文件夹的颜色更改为正常、深色和浅色状态 - Dr. Folder 可从文件夹的弹出菜单更改文件夹的图标。您甚至不需要运行该程序就可更改文件夹图标! - Dr. Folder 的弹出菜单包含方便的类别子菜单。 - Dr. Folder 还包含一个用户图标选项卡,您可在其无限量的添加您喜欢的图标并使用它们标记文件夹。这很简单! Dr. Folder 允许你: - 只需点击鼠标,即可将不同的图标应用于各个文件 - 从系统上下文菜单轻松更改文件夹图标 - 替换由 Windows 用于显示计算机上每个文件夹的系统定义的标准文件夹图标 - 在您的计算机上搜索图标 - 将图标复制到当前文件夹,使您的文件夹图标独立于图标源文件(允许您将自定义文件夹移动或复制到任何地方甚至另一台计算机!您的文件夹将与您指定的完全一致) - 重建系统图标缓存以修复不正确的图标图像 - 将您喜欢的图标添加到用户图标列表以更快地访问它们 - 从 PNG、BMP、JPG 或 GIF 文件转换图标 需要Net4.0,自动注册,便携单文件,Win10闪退请用兼容模式运行
Dr. Folder 官方文名叫目录博士,它是由 YL Computing 公司开发的一个功能强大的工具,用于自定义 Windows 文件夹。 使用 Dr. Folder 这个方便的程序,您可以使用任何引人注目的图标替换单个文件夹的标准文件夹图标,从数百个内置彩色图标选择或由内部图标转换器自动生成。 Windows 文件夹目录博士 Dr. Folder 文版Windows 文件夹目录博士 Dr. Folder 文版 Dr. Folder 优点: 组织有序 – 使用“优先级”图标确定任务的优先级或指示流程进度 节省查找文件的时间 – 只需单击一下即可将文件夹整理好 保护有价值的信息免遭意外删除 – 突出显示不得删除的重要文件夹 个性化您的工作区 – 使您的文件夹与其他文件夹不同,与一台 PC 或 LAN 上的其他用户共享 Dr. Folder 主要特点: 您有权在办公室使用 Dr. Folder Dr. Folder 可以更改网络文件夹图标。所以你可以自定义你的局域网 Dr. Folder 包含办公室工作的其他图标 Dr. Folder 允许您以最简单的方式更改文件夹图标(只需单击一下鼠标) Dr. Folder 还有两个用于更改文件夹图标的选项:“使自定义文件夹可分发”(便携式)和“将所选图标应用于所有子文件夹” Dr. Folder 可以按优先级(高,正常,低),按工作完成程度(完成,完成,计划),工作状态(已批准,已拒绝,待处理)以及包含的信息类型标记文件夹文件夹(工作文件,重要文件,临时文件,私人文件)。 Dr. Folder 可以将文件夹的颜色更改为正常,黑暗和浅色状态 Dr. Folder 从文件夹的弹出菜单更改文件夹图标。要更改文件夹图标,您甚至不需要运行该程序! Dr. Folder 的弹出菜单包含方便的类别子菜单。 Dr. Folder 包含一个用户图标选项卡,您可以在其添加无限量的您喜欢的图标并使用它们标记文件夹。这很简单! 操作系统:Windows XP,Vista,Win7,Win8 / 8.1,Win10 及更高版本(32 位和 64 位) 其实 Dr. Folder 和之前大眼仔给大家分享的 FolderIco 功能类似,它们都可以随意的去让你在当前的系统更改不同个性的文件夹图标。对于习惯了 Windows 本身自带的文件夹颜色来说,无论使用哪种工具,它都能让你的文件夹变的非常有个性。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值