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.
- Python 3.x installed
- Task Scheduler
- A code editor (Literally anything will do)
- 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
- Search up Task Scheduler in your start menu and open it.
- Click on Task Scheduler Library on the left side
- Click on Create Basic task on the right side
- Give it a name and description (if you want to). Click Next
- In triggers, click on Weekly, and then next.
- 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.
- In action, "Start a program" and next
- Browse to where your run.bat file is stored and select it.
- 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!