Python script that includes Outlook through win32com is executed on a double click, but not through the task scheduler

I have a python script that sends an email using win32com and Outlook. The script works without a hitch when I run it through the interpreter or double-click on the script. However, when I run it through the Task Scheduler, I get the following message:

"Something went wrong. We could not start your program. Try to start it again. If it does not start, try to restore Office from the" Programs and Features "in Control Panel."

I am using Office 365 and Python 2.6. I tried to run the script through the scheduler after killing the Outlook process, but I ran into the same problem.

+4
source share
1 answer

The office is not intended to operate as a service and should be run interactively. You will need to reconfigure your task in the Task Scheduler to run the task as the current user on the current user desktop with the current user privileges.

+4
source

Source: https://habr.com/ru/post/1525099/


All Articles