Skip to content

Instantly share code, notes, and snippets.

@rhagni
Created April 11, 2018 04:30
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rhagni/0ef95749374d88dac601ffd7da163612 to your computer and use it in GitHub Desktop.
Save rhagni/0ef95749374d88dac601ffd7da163612 to your computer and use it in GitHub Desktop.
Windows 8 & 10 AdHoc command line helper
@ECHO OFF
IF "%1" EQU "check" GOTO:CHECK
IF "%1" EQU "setup" GOTO:SETUP
IF "%1" EQU "start" GOTO:START
IF "%1" EQU "stop" GOTO:STOP
IF "%1" EQU "show" GOTO:SHOW
IF "%1" EQU "enable" GOTO:ENABLE
IF "%1" EQU "disable" GOTO:DISABLE
IF "%1" EQU "help" GOTO:HELP
:HELP
ECHO.
ECHO Help:
ECHO.
ECHO check : Check if you can host
ECHO setup : Configure initial
ECHO start : Start network
ECHO stop : Stop network
ECHO show : Show network information
ECHO enable : Enable network
ECHO disable : Disable network
ECHO help : Show this help
GOTO:EOF
:CHECK
NETSH WLAN show drivers|findstr /I /C:"Rede hospedada"
NETSH WLAN show drivers|findstr /I /C:"Hosted network"
GOTO:EOF
:SETUP
SET /P ssid=SSID:
SET /P password=Password:
ECHO.
NETSH WLAN set hostednetwork mode=allow ssid=%ssid% key=%password%
GOTO:EOF
:START
NETSH WLAN start hostednetwork
GOTO:EOF
:STOP
NETSH WLAN stop hostednetwork
GOTO:EOF
:SHOW
NETSH WLAN show hostednetwork
GOTO:EOF
:ENABLE
NETSH WLAN set hostednetwork mode=allow
GOTO:EOF
:DISABLE
NETSH WLAN set hostednetwork mode=disallow
GOTO:EOF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment