Reputation: 5
I run a python script from my command prompt once per day, but I want to automate this with task scheduler. I can only make it open Command Prompt, but I have to then run the python program manually. What am I missing?
cmd.exe
"C:\Users\Matthew Olive\PycharmProjects\VOLALGO1\scraper.py"
All I get is the command prompt opening up and it displays: C:\WINDOWS\system32>
It wont actually run the python script.
If I type python "C:\Users\Matthew Olive\PycharmProjects\VOLALGO1\scraper.py"
after C:\WINDOWS\system32>
it will run just fine.
Upvotes: 0
Views: 2278
Reputation: 5
Thanks CaffeinatedCoder! I figured it out!
I used exactly that for the program/script and it worked. Turns out it was running in the python terminal, but it would disappear immediately, so I added input("Press Enter to Exit...")
to the end of the python script.
Upvotes: 0
Reputation: 1607
Instead of using cmd.exe
you could directly use the python.exe
with the full path to it. An example location of where it might be is
C:\Users\MyName\AppData\Local\Programs\Python\Python37-32\python.exe
Upvotes: 1