简体   繁体   中英

How to schedule a script to run at a specified time only on weekdays on Windows 10?

I have tried to run a Python script via the Windows 10 task scheduler but the script will not run:

显示任务计划程序任务设置对话框的屏幕截图

I have double-checked the path to python and to the script. What could be the problem with the task scheduler? Is there any other ways to schedule the script? I need it to run five days a week at a specified time through the day, every week.

You might be able to get additional relevant information from the events log. Open Event Viewer (right-click on Start ). In the left panel select 'Applications and Service Log', then 'Microsoft', then 'Windows', then 'TaskScheduler', the 'Operational'. You might find that the associated middle panel is empty because this log is disabled. In this case, right-click on 'Operational' and enable it temporarily.

Now go to Task Scheduler. Select your task, then click on 'Run' from the right panel a few times, and return to Event Viewer. I hope you will see something useful in the bottom window like

Task Scheduler failed to start "\\Play a video" task for user "DESKTOP-K76A078\\Bill". Additional Data: Error Value: 2147942402.

Presumably the number won't be the same for you. However, you can google for error value nnnnnnnnnn and get various speculations about mistakes or error conditions that you could look for.

Best of luck!

In Windows 10, if you install the Windows 10 Anniversary Update , you'd be able to install the Linux on Windows subsystem. Then, just use cron ( crontab ) to define any recurring task.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM