Start hostednetwork using batch file

Say OL picture Say OL · Feb 9, 2015 · Viewed 9.7k times · Source

When I want to start a local hotspot, I normally run cmd as administrator and type the command netsh wlan start hostednetwork . It wastes of time to run cmd and type this command. Is there any alternative way to do it using bat file?

Answer

KiDo picture KiDo · Feb 23, 2016

Might be late, but save only this line into .bat file:

netsh wlan start hostednetwork

And then use any .bat to .exe converter like this one: Advanced BAT to EXE Converter OR you can use anyone else you like.

Convert it, right click on the new one, Properties -> Compatibility -> Run this program as an administrator

Double click the new .exe file, and there you go!

You need to set the hostednetwork for the first time if you haven't before using this line:

netsh wlan set hostednetwork mode=allow ssid=SSID_NAME key=PASSWORD


IFF you want to run your hostednetwork at startup:

  • Open Run (Windows key + R)
  • type: shell:startup
  • Then copy the .exe file you made previously in that folder.

You may need to enable "Run as an administrator" option for that program after moving it to startup folder.