Skip to content

Instantly share code, notes, and snippets.

@stiig
Last active September 26, 2016 08:53
Show Gist options
  • Save stiig/619a0acfc3219a62e3fe0e5a54f0daac to your computer and use it in GitHub Desktop.
Save stiig/619a0acfc3219a62e3fe0e5a54f0daac to your computer and use it in GitHub Desktop.
Simple bat script for share WiFi
@echo off
CLS
:MENU
ECHO.
ECHO -----------------
ECHO Press 1, 2, 3, 4 or 5 to select your task, or 6 to Exit.
ECHO -----------------
ECHO.
ECHO 1 - Set Wifi Sharing Attributes
ECHO 2 - Start WiFi Sharing
ECHO 3 - Stop WiFi Sharing
ECHO 4 - Show Clients
ECHO 5 - Destroy Wifi Sharing Attributes
ECHO 6 - Exit
ECHO.
SET /P M=Type 1, 2, 3, 4, 5 or 6 then press ENTER:
IF %M%==1 GOTO SET
IF %M%==2 GOTO START
IF %M%==3 GOTO STOP
IF %M%==4 GOTO SHOW_CLIENTS
IF %M%==5 GOTO DESTROY
IF %M%==6 GOTO EOF
:SET
netsh wlan set hostednetwork mode=allow ssid=WiFi key=password keyusage=persistent
GOTO MENU
:START
netsh wlan start hostednetwork
GOTO MENU
:STOP
netsh wlan stop hostednetwork
GOTO MENU
:SHOW_CLIENTS
netsh wlan show hostednetwork
GOTO MENU
:DESTROY
netsh wlan set hostednetwork mode=disallow
GOTO MENU
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment