Skip to content

Instantly share code, notes, and snippets.

@abdulhadad
Last active August 24, 2016 16:27
Show Gist options
  • Save abdulhadad/aa21c82154edfce2710e31930ffd32b6 to your computer and use it in GitHub Desktop.
Save abdulhadad/aa21c82154edfce2710e31930ffd32b6 to your computer and use it in GitHub Desktop.
Start and stop windows 10 hotspot feature
@echo off
set _show_wlan=netsh wlan show drivers
rem see if device support hotspot
for /f "tokens=2 delims=:" %%a in ('%_show_wlan% ^|find "Hosted network supported"') do @set _hn_support=%%a
if "%_hn_support%"==" Yes" (
setlocal EnableDelayedExpansion
set _ssid=Windows10Hotspot
set _password=Windows10
netsh wlan set hostednetwork mode=allow ssid=!_ssid! key=!_password! > nul
netsh wlan start hostednetwork > nul
echo Started hotspot with ssid=!_ssid! and password !_password!
echo Enter to stop hotspot
pause
netsh wlan stop hostednetwork
) else (
echo Cannot start hotspot
pause
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment