Exact Duplicates:
- How to write a batch file to delete the files which are 5 days or older from a folder?
- write a batch file to delete 6 days older files from a folder
- write a batch file to delete 5 daya older files from a folder
- How do I write a batch file to delete folders and files on a time basis?
- write a batch file to remove the folders by date and time wise.
- write a script to delete files from a folder which are 5 days older than current date
如何编写批处理文件以从文件夹中删除5天或更早的文件?
编写批处理文件以从文件夹中删除6天的旧文件
编写批处理文件以从文件夹中删除5 daya旧文件
如何编写批处理文件以按时删除文件夹和文件?
编写批处理文件以按日期和时间删除文件夹。
编写一个脚本来删除文件夹中比当前日期早5天的文件
How do I create a batch script that will delete a folder on a scheduled basis?
如何创建将按计划删除文件夹的批处理脚本?
4 个解决方案
#1
Write a batch script to delete the file
编写批处理脚本以删除该文件
rd <YOURDIR>
and then schedule it in Windows Tasks.
然后在Windows任务中安排它。
#2
Create a batch to delete the file and then place it on a scheduled task on a server or workstation.
创建批处理以删除文件,然后将其放在服务器或工作站上的计划任务中。
#3
You write your batch file and then, even better than using the Scheduler manually, you can use the at command to schedule the .bat file to run periodically.
您编写批处理文件,然后,甚至比手动使用调度程序更好,您可以使用at命令安排.bat文件定期运行。
The advantage of this is that you can put your final at command in a second bat file for easier distribution to your target systems.
这样做的好处是,您可以将最终命令放在第二个bat文件中,以便更容易地分发到目标系统。
at reference page on help.microsoft.com
在help.microsoft.com上的参考页面上
#4
In a text editor do the following
在文本编辑器中执行以下操作
@echo off
rd <enter your directory name here>
Save the file as filename.bat
将文件另存为filename.bat
Create a scheduled task and select the batch file as the file to run.
创建计划任务并选择批处理文件作为要运行的文件。
#1
Write a batch script to delete the file
编写批处理脚本以删除该文件
rd <YOURDIR>
and then schedule it in Windows Tasks.
然后在Windows任务中安排它。
#2
Create a batch to delete the file and then place it on a scheduled task on a server or workstation.
创建批处理以删除文件,然后将其放在服务器或工作站上的计划任务中。
#3
You write your batch file and then, even better than using the Scheduler manually, you can use the at command to schedule the .bat file to run periodically.
您编写批处理文件,然后,甚至比手动使用调度程序更好,您可以使用at命令安排.bat文件定期运行。
The advantage of this is that you can put your final at command in a second bat file for easier distribution to your target systems.
这样做的好处是,您可以将最终命令放在第二个bat文件中,以便更容易地分发到目标系统。
at reference page on help.microsoft.com
在help.microsoft.com上的参考页面上
#4
In a text editor do the following
在文本编辑器中执行以下操作
@echo off
rd <enter your directory name here>
Save the file as filename.bat
将文件另存为filename.bat
Create a scheduled task and select the batch file as the file to run.
创建计划任务并选择批处理文件作为要运行的文件。