Automated tasks under Win10, 5-step quick implementation

Hello everyone, I am Xiaoyi
I previously wrote an article about setting up automation tasks under Linux, but I found that more of my friends work on Windows systems. Therefore, this article will talk about how to set up automation tasks under Windows.

Taking the Win10 system as an example, it is also applicable in the Win7 system.

The Windows application we are going to use today is called a task scheduler, which is mainly used to set triggers and control the execution of scheduled tasks in the computer.

Okay, directly search for [Task] in the search box on the taskbar. Usually, a program like the one shown in the following picture will be displayed. Click on it

After entering, you can see the default scheduled execution program of the current system, including triggers for Google Program updates, Microsoft updates, graphics cards, input methods, and even some default triggers for databases.

In addition, the trigger we have finally set will also be displayed here.

Select 【 Plan Task Library 】 in sequence, right-click 【 Create Basic Task 】 to enter the task creation interface.

Next, you only need five steps to complete the setting of the scheduled task.

Step 1: Create basic tasks
This step mainly involves defining the task name and task description. The task description can be empty

Step 2: Select trigger
Triggers can be set to daily, weekly, monthly, or specific events.

For example, if you want to send emails on a scheduled basis every day, you can set a daily trigger. If the task is executed during the installation of a certain application, you can choose “When a specific event is logged”. If the task is executed every time the computer is turned on, you can choose “When the computer starts”

Step 3: Set trigger events
Based on the trigger selected in the previous step, this step requires specific setting of trigger events.

For example, when do tasks need to be executed every day, or every few days.

Step 4: Select operation type
Select [Start Program] to execute this step

The functions of sending emails and displaying messages have been deprecated by the system. Of course, you can also implement these two functions through Python scripts, both of which are relatively simple.

Step 5: Set the startup program
This step requires filling in three things, as shown in the following figure.

Among them, the [Program or Script] column needs to select the corresponding Python executable exe program, which is the path set during Python installation

The [Add Parameters] column first requires entering the absolute path of the Python py file, and then the required parameters can be entered, separated by spaces.

If the parameter contains spaces, you can wrap it in double quotation marks, as shown in the following example
The content of the program or script needs to be copied from the [Start from] column and saved to its higher-level directory.

For specific settings, please refer to Xiaoyi’s

Program or script

D: \ software \ install \ Python 3.8 \ Python. exe

Add parameters: py file path+input parameters

D: “This is input argv”

Starting from

D: \ software \ install \ Python 3.8\
Afterwards, simply click on the next step and a newly added scheduled task will appear in the list.

The scheduled task added by Xiaoyi is shown in the following figure:

After everything is okay, why not right-click and try running it.

When running Python, a black window will pop up, but you can also set not to pop up the cmd window

If it can run normally, it indicates that the scheduled task in Windows has been set and the task is completed.

Next, you can calmly take out your thermos, soak a cup of goji berries quietly, and look out the window at the clouds rolling and relaxing

I am Xiaoyi, the person who insists on walking towards the twilight will eventually become a dazzling existence.

Looking forward to your triple play. See you next time.

Leave a Reply

Your email address will not be published. Required fields are marked *