Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Windows11Alert 🚀

Windows11Alert Icon

Windows11Alert

A lightweight Windows utility that sends Telegram alerts when your PC starts and reports previous shutdown/restart details on the next startup.

Download EXE

⬇️ Download Latest Windows Installer


📌 Overview

Windows11Alert is a lightweight Windows monitoring utility that sends Telegram alerts when your PC starts.

It also checks Windows Event Logs to detect the previous shutdown/restart event and sends that information on the next startup.

This tool is useful for monitoring when a Windows PC is turned on, restarted, or previously shut down.


✨ Features

  • 🟢 Sends Telegram message when PC turns on
  • 🔴 Sends previous shutdown/restart details on next startup
  • 🖥️ Includes PC name, username, IP address, OS, RAM, processor, and boot time
  • 📜 Reads Windows Event Log for shutdown/restart events
  • 🔐 Uses .env file for Telegram Bot Token and Chat ID
  • 🚀 Automatically adds itself to Windows startup registry
  • 📦 Can be packaged as .exe using PyInstaller
  • 🛠️ Supports installer creation using Inno Setup
  • 🧹 Includes uninstaller support

📸 Example Telegram Message

🟢 PC Turned On

🖥️ PC Name: DEV2
👤 User: HP-User1

🌐 Local IP: 192.168.0.5
🌍 Public IP: xxx.xxx.xxx.xxx

📅 Date & Time: 2026-05-16 15:30:12
⏱️ Boot Time: 2026-05-16 15:29:40

💻 OS: Windows 11
🔢 OS Version: 10.0.xxxxx
⚙️ Processor: Intel64 Family...
🏗️ Architecture: AMD64
🧠 RAM: 15.78 GB Total

📁 Project Structure

TELEGRAMPCALERT/
│
├── icons/
│   ├── alert.ico
│   └── uninstaller.ico
│
├── Windows11Alert.py
├── uninstaller.py
├── Windows11Alert_Setup.iss
├── README.md
├── .gitignore
│
├── build/          # Generated by PyInstaller
├── dist/           # Generated EXE files
└── Output/         # Generated Inno Setup installer

🔧 Requirements

Install the required Python packages:

pip install requests psutil python-dotenv pyinstaller

🔐 Environment Variables

Create a .env file in the project root or beside the final EXE:

TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here
TELEGRAM_CHAT_ID=your_telegram_chat_id_here

Do not push .env to GitHub. It contains sensitive credentials.


🤖 How to Create Telegram Bot

  1. Open Telegram.
  2. Search for BotFather.
  3. Send:
/newbot
  1. Create your bot and copy the bot token.
  2. Send a message to your bot.
  3. Open this URL in browser:
https://api.telegram.org/botYOUR_BOT_TOKEN/getUpdates
  1. Find your chat ID from the response.

▶️ Run Locally

python Windows11Alert.py

On first run, the app will add itself to Windows startup registry.


📦 Build EXE with PyInstaller

Build the main app:

pyinstaller --onefile --noconsole --icon=icons/alert.ico --name Windows11Alert Windows11Alert.py

Build the uninstaller:

pyinstaller --onefile --noconsole --icon=icons/uninstaller.ico --name uninstaller uninstaller.py

Generated files will be inside:

dist/

🏗️ Build Installer with Inno Setup

Open:

Windows11Alert_Setup.iss

Compile it using Inno Setup Compiler.

The final installer will be generated inside:

Output/

Example output:

Output/Windows11Alert_Setup.exe

🚀 Startup Behavior

Windows11Alert automatically registers itself here:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run

This means the app starts automatically when the current Windows user logs in.


🧹 Uninstaller

The uninstaller removes Windows11Alert from startup and closes the running process.

It removes the startup registry value:

HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run\Windows11Alert

🛡️ Security Notes

  • Never commit .env to GitHub.
  • Never hardcode your Telegram Bot Token inside the Python file.
  • If your token is leaked, regenerate it using BotFather.
  • .env is safer than hardcoding, but anything stored on a local PC can still be read by the PC user/admin.
  • For production-level security, use a backend server/proxy instead of storing bot tokens locally.

📂 Files Ignored by Git

This project ignores generated and sensitive files:

.env
build/
dist/
Output/
__pycache__/
*.spec

⚠️ Limitations

  • Shutdown alerts are based on Windows Event Logs and are sent on the next startup.
  • Instant shutdown-time Telegram alerts are not always reliable because Windows may close network services quickly.
  • Unexpected power loss may not always create a clean shutdown event.
  • This tool is designed for Windows only.

🤝 Contributions Are Welcome

Contributions are welcome and appreciated.

You can help improve Windows11Alert by:

  • Reporting bugs
  • Suggesting new features
  • Improving documentation
  • Refactoring code
  • Adding better installer/uninstaller support
  • Improving Telegram alert formatting
  • Adding support for more notification platforms

📝 License

This project is free to use and modify.


👨‍💻 Author (TutorialsAndroid)

Built with Python, Telegram Bot API, PyInstaller, and Inno Setup.

About

A lightweight Windows utility that sends Telegram alerts when your PC starts and reports previous shutdown/restart details on the next startup.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages