How to prevent Windows 10 mobile hotspot from automatically turning off if not used

I had similar problem. When I was not connected to my laptop's win10 mobile hotstop, it will turn itself off.

Tried to look for advanced settings for mobile hotspot but couldn't find, Other people suggested to turn off the power feature of the "network adapter" which in incorrect.

Instead of network adapter, you need to change settings of the hotspot virtual adapter.


Solution:

  1. activate mobile hotspot.

2a. R click wifi system icon, then click network & internet settings. you may need to click mobile hotspot option, then find the network and sharing center

OR

2b. control panel, network and sharing center.

  1. you should see the mobile hotspot connection (check the hotspot ssid name), in addition to you internet wi-fi/ethernet connection.
  2. click on the connection "ex: local area network" under your hotspot connection
  3. click properties
  4. you should see that "connect using" has microsoft wifi direct virtual adapter
  5. configure
  6. power management tab
  7. uncheck - allow the computer to turn off this device to save power

I've created PowerShell script to turn on the Mobile Hotspot if it's not enabled yet. You Can save it as a .ps1 file and add it to the task scheduler (I've used this guide). Here is the script:

Add-Type -AssemblyName System.Runtime.WindowsRuntime
$asTaskGeneric = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and $_.GetParameters()[0].ParameterType.Name -eq 'IAsyncOperation`1' })[0]
Function Await($WinRtTask, $ResultType) {
    $asTask = $asTaskGeneric.MakeGenericMethod($ResultType)
    $netTask = $asTask.Invoke($null, @($WinRtTask))
    $netTask.Wait(-1) | Out-Null
    $netTask.Result
}
Function AwaitAction($WinRtAction) {
    $asTask = ([System.WindowsRuntimeSystemExtensions].GetMethods() | ? { $_.Name -eq 'AsTask' -and $_.GetParameters().Count -eq 1 -and !$_.IsGenericMethod })[0]
    $netTask = $asTask.Invoke($null, @($WinRtAction))
    $netTask.Wait(-1) | Out-Null
}

$connectionProfile = [Windows.Networking.Connectivity.NetworkInformation,Windows.Networking.Connectivity,ContentType=WindowsRuntime]::GetInternetConnectionProfile()
$tetheringManager = [Windows.Networking.NetworkOperators.NetworkOperatorTetheringManager,Windows.Networking.NetworkOperators,ContentType=WindowsRuntime]::CreateFromConnectionProfile($connectionProfile)
if ($tetheringManager.TetheringOperationalState -eq 1) 
{
    "Hotspot is already On!"
}
else{
    "Hotspot is off! Turning it on"
    Await ($tetheringManager.StartTetheringAsync()) ([Windows.Networking.NetworkOperators.NetworkOperatorTetheringOperationResult])
}

I have created a desktop application that continuously checks for the hotspot status and turns it on if it is off, the system tray icon shows hotspot status:

https://github.com/ashvin-bhuttoo/PersistentHotspot


It's a little bit easier on Windows 10 1909: enter image description here

Edit: if that doesn't work, see kriegaex's comment & code below