سرویس هوشمند، فوقکممصرف و رویدادمحور (Event-Driven) برای اتصال مجدد آنی و خودکار به وایفای در ویندوز — مقاوم در برابر قطع ناگهانی VPN، تغییر شبکه و اسلیپ سیستم.
An ultra-low-power, event-driven background service for Windows that monitors Wi-Fi connection states and instantly re-associates with your preferred wireless network. Specially designed to resolve drops caused by VPN disconnections (TUN/TAP/DCO), router blips, or sleep/wake transitions with zero CPU usage.
- ⚡ Instant Event-Driven Wakeup (Zero Lag):
Instead of wasteful polling loops, it listens directly to
.NET NetworkChangekernel events (NetworkAvailabilityChanged&NetworkAddressChanged), waking up within milliseconds when connection drops. - 🛡️ VPN Disconnect Resilience: Specifically solves the issue where turning off VPNs (ExpressVPN, OpenVPN DCO, WireGuard, TUN modes) causes NDIS filter driver shocks or IP resets that drop the physical Wi-Fi connection. Includes automatic connection cycling and DNS cache flush.
- 🔋 Ultra-Low Resource Consumption:
Sleeps deeply on an OS kernel wait handle (
System.Threading.AutoResetEvent). Near 0% CPU and virtually 0% battery drain. - 🎯 Preferred Network Retention: Remembers your active SSID/profile and never connects to unauthorized or unknown networks.
- 👻 Ghost Adapter Immunity:
Accurately identifies the primary physical Wi-Fi hardware (
netsh wlan) while ignoring phantom or disabled adapters (Wi-Fi 2,Wi-Fi 4, virtual miniports). - 🔄 Single-Instance Mutex Protection: Guaranteed single running background instance via Windows Global Mutex.
- 🔇 Completely Invisible (Silent Background):
Launches via VBScript wrapper with
-WindowStyle Hidden— no black terminal popups or intrusive consoles.
- مخزن را دانلود یا کلون کنید:
git clone https://github.com/RMNO21/wifi-auto-reconnect.git cd wifi-auto-reconnect - روی فایل
install.batراستکلیک کرده و اجرا کنید (یا در ترمینال PowerShell فایل.\install.ps1را اجرا کنید).
اسکریپت نصب به صورت خودکار:
- فایلها را در مسیر استاندارد
%LOCALAPPDATA%\WiFiAutoReconnectمستقر میکند. - تسک زمانبندیشدهی سیستمی ویندوز (
WiFi-Auto-Reconnect) را میسازد تا همواره در بالا آمدن ویندوز (Logon) در پسزمینه اجرا شود. - سرویس را بلافاصله فعال میکند.
wifi-auto-reconnect/
├── scripts/
│ ├── wifi_reconnect.ps1 # Core event-driven reconnect monitor
│ └── wifi_hidden.vbs # Zero-window background launcher
├── install.ps1 # Automated installation & Task Scheduler setup
├── install.bat # 1-click installer launcher
├── uninstall.ps1 # Clean removal script
├── uninstall.bat # 1-click uninstaller launcher
├── .gitignore
├── LICENSE # MIT License
└── README.md
flowchart TD
Start([System Boot / Logon]) --> Register[Register .NET NetworkChange Events]
Register --> Sleep[Wait on Kernel Event - 0% CPU Sleep]
Event{Network Event or VPN Drop?} -->|Yes| Wake[Instant Kernel Wakeup]
Sleep -->|Event Fired| Wake
Wake --> CheckStatus[Check WLAN State via Native netsh]
CheckStatus --> IsConnected{Is Wi-Fi Connected?}
IsConnected -->|Yes| SaveProfile[Cache Active SSID & Sleep]
SaveProfile --> Sleep
IsConnected -->|No| BurstConnect[Phase 1: Rapid Burst Reconnect]
BurstConnect --> CheckBurst{Connected?}
CheckBurst -->|Yes| LogSuccess[Log Reconnect & Sleep]
LogSuccess --> Sleep
CheckBurst -->|No| Recovery[Phase 2: Probe Scan + State Reset + Flush DNS]
Recovery --> RetryConnect[Reconnect with Backoff]
RetryConnect --> Sleep
فایل لاگ فعالیتها در مسیر زیر ذخیره و به طور خودکار فشردهسازی و مدیریت میشود (حداکثر ۶۴ کیلوبایت):
%LOCALAPPDATA%\WiFiAutoReconnect\wifi_reconnect_log.txt
برای مشاهده زنده لاگ در PowerShell:
Get-Content "$env:LOCALAPPDATA\WiFiAutoReconnect\wifi_reconnect_log.txt" -Tail 20 -Waitبرای غیرفعالسازی و حذف کامل سرویس:
- کافیست فایل
uninstall.batرا اجرا کنید (یا در PowerShell دستور.\uninstall.ps1را بزنید). - این دستور تسک زمانبندیشده و تمامی پروسههای در حال اجرا را متوقف و حذف میکند.
This project is licensed under the MIT License. Copyright (c) 2026 RMNO21.