I am trying to automate a python script through the Windows Task Scheduler but its not working. At the end of my python script. two CSV files should be created but they arent.
I tried the following: 1. Copied the address of my python.exe to Program/Script.
C:\Program Files\Python35\python.exe
Historical Aggregation.py
C:\Users\myname\PycharmProjects\Project1
Am I missing something
To simplify, we can create a really short .bat
file, that will only receive the necessary command to run your python script.
To do so, try this:
Create a executePy.bat
file in the same folder than your Python file (C:\Users\myname\PycharmProjects\Project1), with content:
@echo off
"C:\Program Files\Python35\python.exe" "Historical Aggregation.py"
Then, on your task scheduler, simply schedule a test with Program/Script:
"C:\Users\myname\PycharmProjects\Project1\executePy.bat"
Leave Add Arguments
and Start In
in blank. Now, your task should be ready to run.