-1
  1. I'm using Windows 10 Task Scheduler to run my python script daily and it runs fine. But I want that script to run only on weekdays Start time: 8.15 AM and End time: 4.15 PM. So here I have configured https://i.stack.imgur.com/SRIKW.jpg But it runs for every 8hrs, i.e, 8.15, 4.15, 12.15 but I want to run it only once a day at a specific time Start time: 8.15 AM and End time: 4.15 PM. So how can I achieve that?

  2. One more thing, If I achieve a solution for the 1st ques next thing is, I don't want to run the script on public holidays or when I'm on leave. So I think that I should sync it with my calendar. First of all, I wanna know is it possible to run the script in that way is there any option for that?

Abbas
  • 3,872
  • 6
  • 36
  • 63
knsaicharan
  • 115
  • 1
  • 11

1 Answers1

0
  1. You should not schedule the task to run every 8 hours if you want it to run only once a day. You should only care about the start time but not the end time.

  2. Depends on you want to read your outlook using COM or you want to tap into Exchange server to read your calendar, you can try this to check your calendar in your script.

adrtam
  • 6,991
  • 2
  • 12
  • 27
  • Thank you. I totally agree with you I'll "Uncheck repeat task every" in the advanced settings. My script is just a selenium python script of logging in and logging out of my account(just hitting the link and clicking login and logout buttons). I've to log in at 8.15 am and logout and 4.15 pm. If I just start the event at 8.15 AM(log in) then how can I run again at 4.15 PM(logout which is after 8hrs). Similarly, run it the next day at the same time(log in) 8.15 AM and again at 4.15 PM(log out) that's making it run twice a day with an 8hrs gap. – knsaicharan Jun 03 '20 at 06:17
  • 1
    I would separate it into two scripts if possible. Otherwise, just add a sleep loop to wait until 4:15PM – adrtam Jun 03 '20 at 14:18