1

I'm temporarily living in a place with no WLAN router and rely on WLAN hotspot on my Windows 11 laptop. As such, I want to turn on hotspot automatically on when I login or when hotspot for whatever reason was turned off (I've turned off energy saving mode but just in case).

The popolar answer on Google search does not work for me. If I run command (as admin)

netsh wlan start hostednetwork //start hotspot

I get an error:

The hosted network has not started.
The group or resource is not in the right state for this operation.

Whereas clicking WLAN hotspot icon in notification bar works normally.

2 Answers2

0

The command syntax is rather :

netsh wlan set hostednetwork mode=allow ssid=ssidName key=your8characterPassword

Unfortunately it must be run with elevated permissions. so you cannot run it automatically as a startup program.

I suggest using the Task Scheduler to create a task that will run a .bat file that contains this command in elevated mode after the boot. Add also a delay to run it enough seconds after the boot, for Windows to settle down and enter a normal mode of working.

There are many articles on internet on using the Task Scheduler. For example:
How to create an automated task using Task Scheduler on Windows 10.

harrymc
  • 498,455
0

its

powershell -ExecutionPolicy Bypass "$connectionProfile = [Windows.Networking.Connectivity.NetworkInformation,Windows.Networking.Connectivity,ContentType=WindowsRuntime]::GetInternetConnectionProfile(); $tetheringManager = [Windows.Networking.NetworkOperators.NetworkOperatorTetheringManager,Windows.Networking.NetworkOperators,ContentType=WindowsRuntime]::CreateFromConnectionProfile($connectionProfile); $tetheringManager.StartTetheringAsync();"

run it from cmd

you could also create a bat file to run it

refer from https://answers.microsoft.com/en-us/windows/forum/all/how-do-i-start-hotspot-through-command-prompt/83267414-51b1-4a20-b7f4-4f3da05d4b4d