I am using Anaconda base environment. I am trying to schedule a task to run python script, using windows task scheduler. The script sends an email to me -
Following is the task scheduler configuration -
Program/script: cmd
Add arguments(optional): "/c conda.bat activate && python myscript.py && deactivate"
When I run this in command prompt as "cmd "/c conda.bat activate && python myscript.py && deactivate", it works fine and I do receive the email as expected. When I run from the task scheduler, it shows Action completed/Task completed etc. No errors in task scheduler, but I don't receive an email. I can't figure out, what really happens when I run the task scheduler. Please let me know if there is anyway to schedule this script that sends email.
Limitations: I am not the admin of the machine and the policy does not allow me to run .bat files
--------------
Update I found an alternative and might be very specific to limitations in my environment. I am able to execute my script using powershell, so I went with that approach and am able to schedule the script. It's likely that group policy/privileges had something to do with, why I was not able to get scheduler to work with previous approach. For using anaconda base environment in powershell, I referenced following topic -
How to activate different anaconda environment from powershell