Skip to content

Instantly share code, notes, and snippets.

@ni554n
Created December 25, 2017 08:17
Show Gist options
  • Save ni554n/59bcc1441ce9c82c6c2e41d664d5536c to your computer and use it in GitHub Desktop.
Save ni554n/59bcc1441ce9c82c6c2e41d664d5536c to your computer and use it in GitHub Desktop.
Easily share Windows local network connection via Wifi Hotspot Utility.
@ECHO OFF
COLOR 00
ECHO :: WiFi Hotspot Utility ::
ECHO --------------------------
:: Set your desired Network name to "ssid" and Password to "key" variable.
netsh wlan set hostednetwork mode=allow ssid=HomePC key=Hello_World >nul
netsh wlan start hostednetwork
ECHO ! Did you enable Internet Connection Sharing of your connected modem?
ECHO If not, this is a one time process:
ECHO * Control Panel -> Network and Internet -> Network Connections.
ECHO.
ECHO * Right click on the device which is connected to internet and select Proerties.
ECHO.
ECHO * Goto "Sharing" tab.
ECHO.
ECHO * Enable "Allow other network users to connect through this computer's Internet connection".
ECHO.
ECHO * Choose the newly created ad-hoc connection from the list.
:stop
ECHO.
SET /P ANSWER="Enter x to stop this hotspot and exit: "
IF /i {%ANSWER%}=={x} (
netsh wlan stop hostednetwork
EXIT /B
)
GOTO :stop
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment