On Windows 10, the Mobile Hotspot feature is automatically disabled when rebooting the machine. Users are required to manually open the Mobile Hotspot settings and toggle the slider for "Share my Internet connection with other devices" in order to enable it.
The included PowerShell script can be added to the Windows Task Scheduler to automatically turn on your Windows 10 Mobile Hotspot upon reboot, login, and unlock of the workstation by any user.
- Copy the two script files to a folder on your computer:
hotspot.ps1
andhotspot.bat
- Open the Windows Task Scheduler.
- Right-click on Task Scheduler Library and select Create Task.
- Enter a Name and Description.
- Select Run whether user is logged on or not.
- Checkmark Run with highest privileges.
- Click the Triggers tab.
- Click New.
- For Begin the task select At startup.
- Checkmark Delay task for: 1 minute.
- Checkmark Stop task if it runs longer than: 30 minutes.
- Checkmark Enabled.
- Click the Conditions tab.
- Uncheck the options Stop if the computer switches to battery power and Start the task only if the computer is on AC power.
- Click OK.
When saving the Task Scheduler, enter your username (username, ADUser\username, CORP\username, etc.) and your Windows password.
If the hotspot enable task is not running after your PC wakes from sleep/hibernation, you can add a trigger to execute the task as soon as possible after waking. Create an additional trigger with the following steps.
- Edit the task and click the Triggers tab.
- For Begin the task select On a schedule.
- Check the radio option Daily.
- Enter the earliest Start Time to run. For example, 8:00 AM EST. This computer does not need to be awake during this time, so it is recommended to make this time earlier than you actually need.
- Select Recur every 1 day.
- Click OK.
- Click the Settings tab.
- Checkmark the option Run task as soon as possible after a scheduled start is missed.
See also Windows 10 Mobile Hotspot Keep Alive Script.
If the mobile hotspot is turning itself off at random periods, you can try the following settings:
-
Disable mobile hotspot power saving by opening the Mobile Hotspot settings and disabling When no devices are connected, automatically turn off mobile hotspot.
-
Set the PeerlessTimeoutEnabled and PublicConnectionTimeout value to a longer duration. This can be done by setting the registry value
HKLM\System\ControlSet001\Services\ICSSVC\Settings\PeerlessTimeoutEnabled
to 120 (Hexadecimal) andHKLM\System\ControlSet001\Services\ICSSVC\Settings\PublicConnectionTimeout
to 60 (Hexadecimal).An example registry script is shown below.
Windows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Services\icssvc\Settings] "PeerlessTimeoutEnabled"=dword:00000120 "PublicConnectionTimeout"=dword:00000060
-
Run the script hotspot-keep-alive.ps1.
You may optionally want to add a condition to run the task whenever you connect to the Internet. This may be done by adding a new "Trigger" to the task scheduler. Select On an event, for "Log" select Microsoft-Windows-NetworkProfile/Operational, for Source select NetworkProfile, for Event ID enter 10000 (enter 10001 for network disconnect instead of connect). Checkmark Delay task for and select 30 seconds.
An easy script to keep the Windows 10 mobile hotspot turned on even if it becomes disabled.