How I automated opening my regular class meetings.

How I automated opening my regular class meetings.

The need?

I'm a high school boy and hence, I have to attend regular classes. Now the problem is that the classes start in the afternoon, at a very irregular time. This was a small inconvenience with me, as I would be coding or playing games before the class started, often forgetting (or being lazy) about the class meetings.

So, I thought of a solution! Since I already knew how to code in python, and about the existence of Windows Task Scheduler, it was pretty much smooth sailing.

Requirements

This was done on Windows, and hence I use task scheduler instead of Cron tasks.

  1. Python 3.x installed
  2. Task Scheduler
  3. A code editor (Literally anything will do)
  4. It has to be a recurring meeting (Constant meeting link)

The Python Part

So, I started by simply creating a new python file in an empty folder (I use VS Code). Next, I imported the webbrowser module. Then I stored my zoom meeting link in a variable, then called webbrowser.open(url). And that's it for the python code! So it looked like this now -

import webbrowser

url = "YOUR MEETING LINK HERE"
webbrowser.open(url)

That's it. Pretty easy right? The webbrowser.open() method opens a new tab in your default browser with the URL you provided. Pretty handy stuff.

Creating a .bat file (Windows only)

It was time to move onto the .bat file. Why, you ask? Well, the task scheduler can't really run python programs directly, so it needs a .bat file to execute python scripts. It looked like this -

@echo off
"PATH_TO_PYTHON/python.exe" "PATH_TO_SCRIPT/script.py

and saved it into run.bat. That's it!

Adding it into Task Scheduler

  1. Search up Task Scheduler in your start menu and open it. task_scheduler1.PNG
  2. Click on Task Scheduler Library on the left side
  3. Click on Create Basic task on the right side
  4. Give it a name and description (if you want to). Click Next
  5. In triggers, click on Weekly, and then next.
  6. Leave the start date as it is, set the time to when your meeting starts, , and add all the days that you have a meeting on. weekly-task.PNG
  7. In action, "Start a program" and next task_scheduler.PNG
  8. Browse to where your run.bat file is stored and select it.
  9. Finish, and you're done! Ez Profit.

That's it!

That's Pretty much how I solved Petty problem! If you have any questions, let me in the comments below!