Triggering Python and py in Task Scheduler does not work

Issue

I create a task in task scheduler to open Python and run a code from a .py file and nothing happens.

Settings of my task:

General

Run whether user is logged in or not TICKED
Run with highest privileges TICKED

Actions

Program/script: C:\ProgramData\Anaconda3\python.exe
Add arguments: code.py (I have also tried "code.py")
Start in (location of my code.py): C:\Users\me\Downloads (I have also tried "C:\Users\me\Downloads")

Once I click Run, nothing happens. Can anyone advise please?

I was expecting that the scheduler will open Spyder, add code and run it. Not sure if this is possible or needed at all?

Solution

The process works. It seems that my python code was not working well.

If you are in doubt just run a simple code with your Task Scheduler:

e.g.

import webbrowser
url = 'https://www.bbc.co.uk/'
webbrowser.open(url)

Answered By – Alien_Explorer

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published