


How to delete files through Windows scheduled tasks
The windows system has its own scheduled tasks. We can use this function to implement scheduled file deletion operations.
(Learning video sharing: Programming video)
Call the bat file through Windows scheduled tasks.
1. First create a new bat file:
bat file description:
forfiles automatically deletes files 7 days ago (based on the current system time)
Example:
Code Code example:
forfiles /p “d:\test” /s /m . /d -7 /c “cmd /c del @path”
replace d:\test with the directory path you want;
/d -7 means to delete files older than 7 days.
2. Set up windows scheduled tasks and bind the bat file.
Search windows-task scheduler
Create task
You need to click the task scheduler library or the menu below the task scheduler library to create a new task.
Set tasks
Fill in the task name-Set security options
Set triggers as required by the business -Run frequency
Click operation-New-Browse-Select the new bat file-Confirm
Click to confirm- You can see the scheduled task you just set in the task list.
Clicking the right button can also run, end and other functions. Is not it simple.
Related recommendations: windows system
The above is the detailed content of How to delete files through Windows scheduled tasks. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Atom editor mac version download
The most popular open source editor

SublimeText3 Linux new version
SublimeText3 Linux latest version

SublimeText3 Mac version
God-level code editing software (SublimeText3)

SublimeText3 English version
Recommended: Win version, supports code prompts!

SAP NetWeaver Server Adapter for Eclipse
Integrate Eclipse with SAP NetWeaver application server.