2
votes

I would like to schedule a .pyw script in Task Scheduler on Windows. When I double click on the file, everything works properly, the program does what it should do. I successfully create a task in Task Scheduler: -'Run with highest privileges' checked -Configure for Windows 10 -'At system startup' trigger -Action: 'Start a program' and I provide the full path to the .pyw script -I have also unchecked 'Start the task only if the computer is on AC power'

..and when I do right click --> Run, I get a standard question: "How do you want to open this file" etc. Now, status of the task is 'Running', but nothing happens, and I cannot find my program running in Task Manager. Any advice?

2

2 Answers

1
votes

You should provide a full path to the python interpreter and in the optional parameters add the path to your script. Just like in cmd, when you run a python script, you type python first, works the same with the task scheduler.

0
votes

To details Max's answer:

in the "program/script" field you should write:

"C:\Users\Me\AppData\Local\Programs\Python\Python36\pythonw.exe"

(⚠ it won't work with python.exe)

In the "add arguments" field:

"C:\Users\Me\Desktop\test.pyw"