Dr_V
Dr_V

Reputation: 25

Schedule and MANUALLY run .pyw script in Task Scheduler on Windows

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?

Upvotes: 2

Views: 1150

Answers (2)

JinSnow
JinSnow

Reputation: 1663

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"

Upvotes: 1

Max
Max

Reputation: 1175

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.

Upvotes: 1

Related Questions