0

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?

  1. New Folder myTasks
  2. Create basic Task
  3. Task name, trigger, start a program
  4. Program script/ cmd.exe
  5. Add Arguments: "C:\Users\Matthew Olive\PycharmProjects\VOLALGO1\scraper.py"
  6. Manually Run Task to test it

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.

2 Answers 2

1

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
Sign up to request clarification or add additional context in comments.

Comments

0

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.

1 Comment

That's great to hear! If my solution resolved your question please consider accepting it as the answer by clicking the checkmark next to it :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.