Skip to content

Instantly share code, notes, and snippets.

@borgle
Created September 2, 2015 09:20
Show Gist options
  • Save borgle/eb07261ba173c46da8eb to your computer and use it in GitHub Desktop.
Save borgle/eb07261ba173c46da8eb to your computer and use it in GitHub Desktop.
在window系统上辅助建立WiFi热点的批处理脚本
@echo off
Title PC Wifi Helper.
:start
echo Please choose method to Dial:
echo 1. Create WiFi hosted
echo 2. Start Wifi hosted
echo 3. Stop Wifi hosted
echo x. Exit
choice /c 123x /n /m Select: /t 10 /d x
if %errorlevel%==1 cls & goto createwifi
if %errorlevel%==2 cls & goto startwifi
if %errorlevel%==3 cls & goto stopwifi
if %errorlevel%==4 goto eof
:createwifi
cls
set WiFiNAME =
set WiFiPASS =
set /p WiFiNAME=WIFI Name(wifi9721):
if "%WiFiNAME%"=="" set WiFiNAME=wifi9721
set /p WiFiPASS=WIFI Password(12345678):
if "%WiFiPASS%"=="" set WiFiPASS=12345678
echo ......................................................
echo Create Virtual WiFi With Name "%WiFiNAME%" and password "%WiFiPASS%"
echo ......................................................
netsh wlan set hostednetwork mode=allow ssid=%WiFiNAME% key=%WiFiPASS%
echo .
echo Now, you need to go to Network control panel ^& setting share on local network.
goto start
:startwifi
cls
netsh wlan start hostednetwork
goto start
:stopwifi
cls
netsh wlan stop hostednetwork
goto start
:eof
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment