How to run Python script in task scheduler?
Hi everybody!
I have a simple script that parse the. XLSX file and generates some CSV using the library openepyxl. I made it into a. EXE file using the pyinstaller to run on a machine where no Python, using the task scheduler.
Problem: if you run the. exe file or script by hand, everything works fine. If you run the same script or exe using Windows scheduler, the task is not running, and the result 0xFF. The job runs under a service user rights to run there. If you set the scheduler to set the option "Run only when user is logged in", then it works, if you set the option to launch out whichever user is logged in or not, nothing works.
Has anyone encountered similar? Apparently, the library requires interactivity from the session.
1 answer
the path to the Python file is absolute
inside the script all the way - absolute
Find more questions by tags The task schedulersWindowsPython
To eliminate this problem, tried to make a batch file where the first line was the team CD АбсолютныйПутьКДиректорииГдеЛежитскрипт to run script from it.
Try to specify the absolute path to these files. - Freddy_Ratke commented on April 19th 20 at 12:25