search
HomeOperation and MaintenanceWindows Operation and MaintenanceHow to delete files through Windows scheduled tasks

How to delete files through Windows scheduled tasks

Dec 31, 2020 am 10:15 AM
windowsscheduled tasksdocument

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.

How to delete files through Windows scheduled tasks

How to delete files through Windows scheduled tasks

2. Set up windows scheduled tasks and bind the bat file.
Search windows-task scheduler

How to delete files through Windows scheduled tasks

Create task
You need to click the task scheduler library or the menu below the task scheduler library to create a new task.

How to delete files through Windows scheduled tasks

Set tasks
Fill in the task name-Set security options

How to delete files through Windows scheduled tasks

Set triggers as required by the business -Run frequency

How to delete files through Windows scheduled tasks

Click operation-New-Browse-Select the new bat file-Confirm

How to delete files through Windows scheduled tasks

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.

How to delete files through Windows scheduled tasks

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!

Statement
This article is reproduced at:csdn. If there is any infringement, please contact admin@php.cn delete

Hot AI Tools

Undress AI Tool

Undress AI Tool

Undress images for free

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

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

Hot Tools

SAP NetWeaver Server Adapter for Eclipse

SAP NetWeaver Server Adapter for Eclipse

Integrate Eclipse with SAP NetWeaver application server.

DVWA

DVWA

Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

EditPlus Chinese cracked version

EditPlus Chinese cracked version

Small size, syntax highlighting, does not support code prompt function

Atom editor mac version download

Atom editor mac version download

The most popular open source editor

mPDF

mPDF

mPDF is a PHP library that can generate PDF files from UTF-8 encoded HTML. The original author, Ian Back, wrote mPDF to output PDF files "on the fly" from his website and handle different languages. It is slower than original scripts like HTML2FPDF and produces larger files when using Unicode fonts, but supports CSS styles etc. and has a lot of enhancements. Supports almost all languages, including RTL (Arabic and Hebrew) and CJK (Chinese, Japanese and Korean). Supports nested block-level elements (such as P, DIV),