9

for some weird reason I can't use netsh wlan start hostednetwork and instead I am using the windows 10 option "Mobile hotspot". My problem is that I want to turn on the hotspot automatically on startup, is there a way to do it ?

On my other laptop I used netsh commands in a .bat file for this purpose, but this won't work now. I tried to run the same .bat file that I used on my other laptop and it's failing. Also, if I do netsh wlan show drivers I get the following line (among others): Hosted network supported : No

Just to be clear, I can use Mobile hotspot through the windows 10 interface normally, my problem is that I want to turn it on automatically on startup. I searched a lot and I can't find a solution to this ...

Bonus question: While trying to find out if I can do this with a service (Windows key + R => services.msc), I probably bugged something (even though I turned all options back when I touched something), because the mobile hotspot needs to be clicked twice after a few seconds to be turned on now. Any idea how I can reset all the services to default ? Note: The Windows Mobile Hotspot service didn't help when I switched it to turn on automatically.

4
  • Hosted network supported : No means no AP mode not supported by driver or likely by hardware. – Free Consulting May 9 '19 at 2:59
  • See this answer written by me, w/explanation and working c++/code – smallscript Feb 28 '20 at 4:09
  • You should accept ManSamVampire's answer, because it works even for Hosted network supported : No (like in my own case) and does not even need admin rights. – kriegaex Jul 22 at 1:32
  • @kriegaex haven't tested, but seems everyone's happy with it – George Dimitriadis Jul 22 at 10:32
8

As mentioned in many other answers on Superuser, there is a simple way to turn on the Windows 10 Mobile Hotspot using Powershell commands (and it doesn't even require admin rights).

With reference to the answer given here by @DanceDance -

$connectionProfile = [Windows.Networking.Connectivity.NetworkInformation,Windows.Networking.Connectivity,ContentType=WindowsRuntime]::GetInternetConnectionProfile()
$tetheringManager = [Windows.Networking.NetworkOperators.NetworkOperatorTetheringManager,Windows.Networking.NetworkOperators,ContentType=WindowsRuntime]::CreateFromConnectionProfile($connectionProfile)

# Start Mobile Hotspot
$tetheringManager.StartTetheringAsync()

# Stop Mobile Hotspot
$tetheringManager.StopTetheringAsync()

# Check whether Mobile Hotspot is enabled
$tetheringManager.TetheringOperationalState

You can add the relevant part of it to a PowerShell script (PS1) and execute it on boot by adding a task to Task Scheduler and setting a trigger to 'On Startup' or 'At Logon' (Read more about it here)


Here is Microsoft's documentation about the NetworkOperatorTetheringManager Class which contains some other useful functions that might help people looking forward to add additional functionality to their PowerShell script.

4
  • OMG, this is it!!! I tried netsh wlan start hostednetwork, which does not work with some Intel WiFi adapters due to missing Soft AP. I was puzzled that it worked via Windows GUI, though. There had to be a series of CLI commands doing the same as Windows does behind the scenes. This script works. There seems to be a new Windows bug since the latest update, which deactivates the mobile hotspot every night when my WiFi reconnects. This script mitigates that. – kriegaex Jul 22 at 1:28
  • One more question: In order to automate reactivation of mobile hotspot, is there a way to query the status and only activate it when turned off? Or even better, can I use task scheduler in order to trigger it when and only when it is turned off, reacting to an event, in order to make this more a push than a pull (polling) solution? – kriegaex Jul 22 at 1:30
  • 1
    To answer the first part of my own question: $a.TetheringOperationalState tells us whether the mobile hotspot is currently on or off. – kriegaex Jul 22 at 2:03
  • 1
    Glad you found it! The original answer by @DanceDance does have an advanced script that also checks the current state of the hotspot. Also, I've updated my answer to include Microsoft's documentation link which lists all the properties of the class. – ManSamVampire Jul 22 at 2:25
2

I am unaware of how to start Mobile Hotspot through any Windows executable. I do not believe such a thing is possible due to how these Windows 10 Settings are being developed.

If you do netsh wlan show wirelesscapabilities and it says Soft AP is disabled, then your driver does not support a "Hosted Network"

However, it is possible, though a long shot depending on your adapter, to try and go back multiple driver versions before they disabled Soft AP (assuming at one point Soft AP was allowed). If you have a Intel Dual Band Wireless-AC 3165 (like I have) or maybe similiar, then you would have to go back to pre-Driver Version 18.10 where they disabled it. If you don't have that driver, there is a chance that it was enabled in earlier versions, going through the manufacturer's archive of drivers for your wireless adapter may be worth your time.

Regarding your "bonus question" you should follow this guide, where you would download a zip file containing the default states (from a fresh install of Windows 10) stored in a reg file. In the zip file you just have to click on the ones you want to reset individually. Also, unrelated "bonus questions" should have their own post, otherwise your post may not be answered for months as demonstrated by this post.

1
  • That's a useful suggestion, thanks! I wouldn't guess to check old driver version, but at this point it's not worth my time because I'm using a router now. – George Dimitriadis Oct 1 '18 at 7:24

Not the answer you're looking for? Browse other questions tagged or ask your own question.