0

I have a script which I want to run on a daily basis at the same time, automatically. I tried to use Windows Task Scheduler. but no luck so far. FYI I can run the same script from the console without any issue.

I tried

where python   
C:\Users\name\Anaconda3\python.exe  
C:\Users\name\AppData\Local\Programs\Python\Python38\python.exe   
C:\Users\name\AppData\Local\Microsoft\WindowsApps\python.exe

on TaskScheduler

Program/script:     "C:\Users\name\AppData\Local\Programs\Python\Python38\python.exe"
Add arguments:       Nomura_Daily_PnL_Check.py
Start in:           "C:\Users\name\Jobs\scripts_need_to_run_daily"

when the scheduled time come, literally nothing happens. No error, No output, nothing!

what is wrong in this process?

K saman
  • 151
  • 6

1 Answers1

0

try mentioning values without double inverted commas, like:

Program/script:     C:\Users\name\AppData\Local\Programs\Python\Python38\python.exe
Add arguments:       Nomura_Daily_PnL_Check.py
Start in:           C:\Users\name\Jobs\scripts_need_to_run_daily

Also first try to run a simple program, lets say a python program which will write to a file so that you will know whether task is failing or there is some issue with your program.

JayantSeth
  • 348
  • 1
  • 12
  • took the commas didn't changed anything, but I did run a super simple task and it was Okay!! more confused now. – K saman Jun 26 '21 at 23:01
  • 1
    that is interesting, since your code works when you run it manually and fails to run via task scheduler and a simple task runs via task scheduler, it means there is no issue with your code or your method to schedule it in task scheduler, the issue can be with python environment are you using any python environment ?, Instead of using task scheduler you can also convert your python script into windows service, please find this [link](https://stackoverflow.com/questions/32404/how-do-you-run-a-python-script-as-a-service-in-windows) for converting python program into windows service. – JayantSeth Jun 28 '21 at 04:25
  • after I fixed the Task Scheduler 0*1 error, everything worked well – K saman Jun 30 '21 at 02:16