A Script that Notifies the user when a required level is reached while Charging the PC/Laptop
📦BatteryNotification
┣ 📂venv
┣ 📜app.py
┣ 📜mybattery.bat
┗ 📜charge.vbs
create a virtual environment inside any folder and place the app.py with venv folder
create a .bat
file with the code as below with any name. (eg. mybattery.bat )
@echo off
"PYTHON_EXE_PATH"
"APP.PY_PATH"
exit
Here replace PYTHON_EXE_PATH with python exe path inside venv and replace APP.PY_PATH with app.py path
-
(Eg. replace
PYTHON_EXE_PATH
with "C:\Users\pavan\Desktop\Python_Projects\BatteryNotification\venv\Scripts\python.exe" ) -
(Eg. replace
APP.PY_PATH
with C:\Users\pavan\Desktop\Python_Projects\BatteryNotification\app.py )
Create a vbs file in the same directory with the below code inside it.(Eg. charge.vbs)
This file is needed to make the hovering cmd screen on desktop to disappear.
CreateObject("Wscript.Shell").Run "BAT_FILE_PATH", 0, True
Replace the BAT_FILE_PATH with the path of bat file inside the vbs file.
- (Eg. replace
BAT_FILE_PATH
with "C:\Users\pavan\Desktop\Python_Projects\BatteryNotification\mybattery.bat" )
Create a shortcut for the .vbs file and place it inside the below mentioned path.
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp
So whenever you power on your PC/Laptop, app.py with be running in the background and notifies you whenever the battery if Full.