{"id":17806138,"url":"https://github.com/luizbizzio/windows-auto-hotspot","last_synced_at":"2025-07-05T06:37:43.142Z","repository":{"id":259286216,"uuid":"876980644","full_name":"luizbizzio/windows-auto-hotspot","owner":"luizbizzio","description":"PowerShell script that automatically enables and disables your PC's Wi-Fi hotspot based on Ethernet connection status. Ideal for laptops, it activates the hotspot when Ethernet is connected, ensuring seamless internet sharing without manual intervention.","archived":false,"fork":false,"pushed_at":"2024-10-23T18:44:00.000Z","size":764,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-10-24T04:35:28.978Z","etag":null,"topics":["automation","automation-tools","ethernet","hotspot","internet-sharing","network-management","networking","powershell","scripts","task-scheduler","wifi-hotspot","windows","windows-scripts"],"latest_commit_sha":null,"homepage":"","language":"PowerShell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luizbizzio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-22T22:02:26.000Z","updated_at":"2024-10-23T21:48:47.000Z","dependencies_parsed_at":"2024-10-24T04:35:30.280Z","dependency_job_id":"9a33b091-8b18-4841-8cb6-16c42de2f184","html_url":"https://github.com/luizbizzio/windows-auto-hotspot","commit_stats":null,"previous_names":["luizbizzio/windows-auto-hotspot"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizbizzio%2Fwindows-auto-hotspot","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizbizzio%2Fwindows-auto-hotspot/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizbizzio%2Fwindows-auto-hotspot/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luizbizzio%2Fwindows-auto-hotspot/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luizbizzio","download_url":"https://codeload.github.com/luizbizzio/windows-auto-hotspot/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221678265,"owners_count":16862395,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automation","automation-tools","ethernet","hotspot","internet-sharing","network-management","networking","powershell","scripts","task-scheduler","wifi-hotspot","windows","windows-scripts"],"created_at":"2024-10-27T13:04:19.413Z","updated_at":"2025-03-17T12:31:24.021Z","avatar_url":"https://github.com/luizbizzio.png","language":"PowerShell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Windows Auto Hotspot 🪟🛜\n\n**Windows Auto Hotspot** is a PowerShell script that automatically manages your PC's **Wi-Fi hotspot**. It enables the hotspot when an Ethernet cable is connected (including via USB adapters) and disables it when disconnected. Follow the steps below to configure and automate the process using **Task Scheduler**.\n\n### How Does It Work? 🤔\n\n**Windows Auto Hotspot** automates the process of turning your PC into a Wi-Fi hotspot whenever an Ethernet cable is connected. The script runs in the background, activating the hotspot when a wired connection is detected, and disabling it when the cable is unplugged. This eliminates the need for manual management—it's all done automatically.\n\n   \u003cdiv align=\"center\"\u003e\n      \u003cimg src=\"./images/Powershell.png\" alt=\"Powershell\" width=\"900\"/\u003e\n   \u003c/div\u003e\n\n---\n\n### Why Ethernet? 🌐\n\nThis script works exclusively with Ethernet connections. It is designed for environments where your primary internet access is through a wired connection, ensuring seamless sharing via your PC’s Wi-Fi.\n### Perfect for Laptop Users 💻\n\nLaptop users will find this script especially useful. If you prefer to close your laptop lid and still keep the hotspot running, you can adjust your system settings to ensure the laptop doesn't go into sleep mode while plugged into power. This allows the hotspot to continue operating even when the lid is closed, making it an ideal solution for keeping your devices connected without interruptions.\n\nFor example, you can configure your laptop to stay awake when connected to power, allowing you to use it as a permanent hotspot while keeping it out of the way—no need to keep the screen open or active.\n\n### Key Advantages 🔑\n- **Fully Automated**: The script starts automatically with the system and activates the hotspot when an Ethernet cable is detected.\n- **Ethernet-Exclusive**: It only works with Ethernet connections, perfect for homes and offices that rely on wired internet.\n- **Optimized for Laptops**: You can close your laptop lid without putting it to sleep, allowing the hotspot to keep running while plugged into power.\n- **Continuous Monitoring**: Runs silently in the background and adjusts the hotspot as needed.\n\nWhether you're working in an Ethernet-only environment, need a reliable and automated hotspot solution for your laptop, or just want to ensure all your devices stay connected, **Windows Auto Hotspot** is the perfect solution.\n\n---\n\n## Requirements ✅\n\n- *Windows* 10 or higher.\n- *Administrator privileges* to run the PowerShell script.\n- A PC with an *Ethernet adapter*, either built-in or via *USB Ethernet adapter*, and a *Wi-Fi adapter*.\n\n## Step-by-Step Instructions 🖥️\n\n### 1. Configure Your Wi-Fi Hotspot\n\nBefore using the script, you need to manually configure your Wi-Fi hotspot settings on Windows:\n\n1. **Open Hotspot Settings**:\n   - Go to **Settings \u003e Network \u0026 Internet \u003e Mobile Hotspot**.\n\n   \u003cbr\u003e\n\n   \u003cdiv align=\"center\"\u003e\n      \u003cimg src=\"./images/Hotspot%20Settings.png\" alt=\"Hotspot Settings\" width=\"900\"/\u003e\n   \u003c/div\u003e\n\n   \u003cbr\u003e\n\n2. **Set the SSID and Password**:\n   - Choose your **Network Name (SSID)** and **Password**.\n\n   \u003cbr\u003e\n\n   \u003cdiv align=\"center\"\u003e\n      \u003cimg src=\"./images/Network%20Info.png\" alt=\"Network Info\" width=\"500\"/\u003e\n   \u003c/div\u003e\n\n   \u003cbr\u003e\n\n3. **Select the Connection Type**:\n   - If your device supports it, select between **2.4GHz** and **5GHz** for your Wi-Fi hotspot.\n4. **Enable Internet Sharing**:\n   - Set **Share my Internet connection** to **Wi-Fi**.\n\nOnce your hotspot is configured, you can move on to the next steps.\n\n### 2. Download and Place the Script\n\n1. Download the **Windows Auto Hotspot** script from this repository.\n2. Place the script in a directory of your choice. It is recommended to save it in your **user's folder** (e.g., `C:\\\\Users\\\\YourUser\\\\Documents`) or any easily accessible folder.\n\n### 3. Set Up Task Scheduler\n\nNow, let's automate the script using **Task Scheduler**:\n\n1. **Open Task Scheduler**:\n   - Search for **Task Scheduler** in the Windows Start menu and open it.\n\n   \u003cbr\u003e\n\n   \u003cdiv align=\"center\"\u003e\n      \u003cimg src=\"./images/Create%20Task.png\" alt=\"Create Task\" width=\"400\"/\u003e\n   \u003c/div\u003e\n\n   \u003cbr\u003e\n\n2. **Create a New Task**:\n   - Click on **Create Task** in the right sidebar.\n   - Name the task something like \"Windows Auto Hotspot\".\n   - Check **Run whether user is logged on or not** and **Do not store password**.\n   - Check **Run with highest privileges**.\n\n   \u003cbr\u003e\n\n   \u003cdiv align=\"center\"\u003e\n      \u003cimg src=\"./images/General.png\" alt=\"General\" width=\"500\"/\u003e\n   \u003c/div\u003e\n\n   \u003cbr\u003e\n\n### 4. Configure the Triggers\n\n1. **Create a Trigger**:\n   - Go to the **Triggers** tab and click **New**.\n   - Set **Begin the task** to **At startup**.\n   - Under **Advanced settings**, check **Repeat task every** 5 minutes, and set the duration to **Indefinitely**.\n   - Make sure the **Enabled** box is checked.\n\n   \u003cbr\u003e\n\n   \u003cdiv align=\"center\"\u003e\n      \u003cimg src=\"./images/New%20Trigger.png\" alt=\"New Trigger\" width=\"500\"/\u003e\n   \u003c/div\u003e\n\n   \u003cbr\u003e\n\n### 5. Configure the Actions\n\n1. **Set Action to Start PowerShell**:\n   - Go to the **Actions** tab and click **New**.\n   - Set **Action** to **Start a program**.\n   - In the **Program/script** field, enter:\n\n     ```bash\n     powershell.exe\n     ```\n\n   - In the **Add arguments** field, enter:\n\n     ```bash\n     -ExecutionPolicy Bypass -File \"C:\\\\path_to_script\\\\windows_auto_hotspot.ps1\"\n     ```\n\n     Replace `\"C:\\\\path_to_script\\\\windows_auto_hotspot.ps1\"` with the actual path where you saved the script.\n\n   \u003cbr\u003e\n\n   \u003cdiv align=\"center\"\u003e\n      \u003cimg src=\"./images/New%20Action.png\" alt=\"New Action\" width=\"500\"/\u003e\n   \u003c/div\u003e\n\n   \u003cbr\u003e\n\n### 6. Configure Conditions and Settings\n\n1. **Conditions**:\n   - Uncheck everything in the **Conditions** tab (nothing should be enabled).\n\n   \u003cbr\u003e\n\n   \u003cdiv align=\"center\"\u003e\n      \u003cimg src=\"./images/Conditions.png\" alt=\"Conditions\" width=\"500\"/\u003e\n   \u003c/div\u003e\n\n   \u003cbr\u003e\n\n2. **Settings**:\n   - In the **Settings** tab, check the following options:\n     - **Allow task to be run on demand**.\n     - **Run task as soon as possible after a scheduled start is missed**.\n     - **Do not start a new instance**.\n\n   \u003cbr\u003e\n\n   \u003cdiv align=\"center\"\u003e\n      \u003cimg src=\"./images/Settings.png\" alt=\"Settings\" width=\"500\"/\u003e\n   \u003c/div\u003e\n\n   \u003cbr\u003e\n\n### 7. Done! 🎉\n\nYour script is now set up to run at startup and will check to enable or disable the hotspot based only on the Ethernet connection status.\n\nIf you found this script helpful, feel free to ⭐ star the repository or fork it for your own customization!\n\n---\n\n## License 📄\n\nThis project is licensed under the Apache License 2.0 - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluizbizzio%2Fwindows-auto-hotspot","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluizbizzio%2Fwindows-auto-hotspot","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluizbizzio%2Fwindows-auto-hotspot/lists"}