1

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

screenshot showing task scheduler task settings dialog

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.

martineau
  • 119,623
  • 25
  • 170
  • 301
IvelinI
  • 21
  • 1
  • Perhaps the script is not being run with the right credentials. I don't know how those are specified in Win 10's task scheduler, but this [answer of mine](http://stackoverflow.com/a/4209102/355230) to a related question might help you figure it out. – martineau Feb 11 '17 at 16:21
  • Check the Windows event log to see if there are any error messages logged when it tries to start the task. Also what is drive F: ? Scheduled tasks may not be able to access networked drives. – Duncan Feb 11 '17 at 16:36
  • 1
    Maybe this can help https://stackoverflow.com/a/44873579/3154274 – MagTun Jul 02 '17 at 17:48

2 Answers2

1

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!

Bill Bell
  • 21,021
  • 5
  • 43
  • 58
0

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.

boardrider
  • 5,882
  • 7
  • 49
  • 86