My question is related to this, but none of the solutions presented there worked for me. I'm trying to schedule a .py file to run daily using Windows Task Scheduler. The .py file downloads some data and then emails it to someone. I followed the directions here to do this. I can run my .bat file just fine and it downloads the data and emails it.
In Windows Task Scheduler the task is listed as 'Task completed' and also says 'Task Scheduler successfully finished "{7fd6d9a4-82d4-4a43-ba8b-a67a14e17b25}" instance of the "\OBCapacity_SOP" task for user "ANT\user1". However, Last Run Result for the task says '(0x1)' and the data never downloads or gets emailed. Here's how I've set up Task Scheduler for this job in Actions:
Start a Program
Program/script: C:\Users\user1\Documents\COVID19_S&OP\COVID19_SOP.bat
Start in (optional): C:\Users\user1\Documents\COVID19_S&OP\
The task is currently set to only run when user is logged on. Any ideas on how I can fix this problem?