A smart automation script designed to eliminate the frustration of connecting to your mobile hotspot manually. Whether you wake your PC from sleep or restart, this script ensures your specific hotspot is connected instantly.
Windows' built-in "Connect Automatically" feature often fails if your PC powers on before your phone's hotspot is active. In most cases, users are forced to:
- Open the Wi-Fi menu manually.
- Wait for the OS to "discover" the network (often taking 10–20 seconds).
- Manually click "Connect" and hope for the best.
My Batch script solves this by actively polling and forcing a connection the moment the hotspot becomes available.
- Auto-Swap: Disconnects existing weak or unwanted Wi-Fi networks to prioritize your hotspot.
- Smart Retry Loop: Continuously searches for your hotspot until the connection is established.
- Information Hub: Once connected, it displays real-time signal strength, channel, and IP address.
- Hacker Aesthetic: A clean, centered ASCII interface with a success-green theme.
- UTF-8 Optimized: Uses safe block characters for a modern terminal look without crashing.
- Download the
Hotspot_Auto_Connect.batfile. - Right-click and select Edit.
- Replace
Nothing Phone (2a)_7232with your specific Hotspot Name (SSID). - Save the file in a safe folder (e.g.,
C:\Scripts\).
To make the script run every time you unlock your laptop or wake it from sleep:
- Open Task Scheduler: Press
Win + Sand type "Task Scheduler". - Create Task: Click Create Task (on the right panel).
- General Tab:
- Name:
AutoConnectHotspot. - Check: Run with highest privileges.
- Name:
- Triggers Tab:
- Click New.
- Begin the task: Select On workstation unlock.
- Actions Tab:
- Click New.
- Action: Start a program.
- Program/script: Click Browse and select your
.batfile.
- Conditions Tab:
- Uncheck: "Start the task only if the computer is on AC power" (Crucial for laptops).
- Check: Wake the computer to run this task.
- Click OK.
The script utilizes a 4-step logic:
- Check: Verifies if already connected to avoid redundant loops.
- Force: Disconnects existing Wi-Fi profiles to clear the path.
- Connect: Triggers
netsh wlan connectin a retry loop. - Audit: Extracts network data using
ipconfigandnetshinterfaces for verification.
This project is licensed under the MIT License - feel free to modify and share!
Mogdho Paul
🔗 GitHub: github.com/mogdho 📂 Source: Hotspot-Auto-Connect