I want to run a python script at a particular time. say Everyday 10am or every 2 hours
. How can I achieve that? I have read these questions-
Q1 Q2
Asked
Active
Viewed 798 times
0

skysoft999
- 540
- 1
- 6
- 27
-
So what's unclear after reading these links? – timgeb Apr 26 '18 at 07:34
-
1Setting timer and scheduling time MR @timgeb . I'm a python beginner. Please guide me. – skysoft999 Apr 26 '18 at 07:35
-
1Why do you need a service for that? Can't you use [schtasks](https://msdn.microsoft.com/en-us/library/windows/desktop/bb736357(v=vs.85).aspx)? – Ocaso Protal Apr 26 '18 at 07:45
1 Answers
1
You don't need a service to schedule a Python script. Just use Windows Task Scheduler to run it. When I do this I usually wrap the invocation of Python in a batch file, so the scheduler runs mytask.cmd
but you can also schedule a complete command line invocation of the interpreter, for example: c:\python36\python.exe mytask.py
.
Task Scheduler is in the Control Panel. Open Control Panel, and in the top right hand corner ("Search Control Panel") type Schedule. One of the options you will get is Administrative Tools | Schedule tasks.

BoarGules
- 16,440
- 2
- 27
- 44
-
1
-
-
That's okay can we do this scheduling through batch script? Basically i don't want to deal with GUI. If i run a simple batch script will it able to schedule task? any idea ? @BoarGules – skysoft999 Apr 26 '18 at 08:14
-
To do it from the command line use `schtasks.exe`. Documentation here: https://msdn.microsoft.com/en-us/library/windows/desktop/bb736357(v=vs.85).aspx – BoarGules Apr 26 '18 at 08:16
-