@echo off
echo 请确认你是以管理员的方式运行本程序的
:start
pause
cls
echo *********************************************
echo * wifi control *
echo * 0 start wif *
echo * 1 creat wif *
echo * 2 stop wifi *
echo * 3 show information *
echo * 4 exit *
echo *********************************************
set /p iit= please input your choice:
if "%iit%" equ "1" (
netsh wlan set hostednetwork mode=allow ssid=IT05 key=12345678 //注意这里自己设置ssid和key,key的位数有要求的,至少8位
if %errorlevel% neq 0 (
echo failed!
goto end
)
echo please ensure your network is sharing ! //设置你的网,需要它共享到你新建的无限虚拟网
echo if so, press any key to continue !
echo else please go and set it and then come back here to go on !
pause
netsh wlan start hostednetwork
if %errorlevel% neq 0 (
echo failed!
goto end
)
echo success start !
)
if "%iit%" equ "0" (
netsh wlan start hostednetwork
if %errorlevel% neq 0 (
echo failed to start wifi !
goto end
)
)
if "%iit%" equ "2" (
netsh wlan set hostednetwork mode=disallow
if %errorlevel% neq 0 (
echo failed!
goto end
)
netsh wlan stop hostednetwork
if %errorlevel% neq 0 (
echo failed!
goto end
)
echo success stop !
)
if "%iit%" equ "3" (
netsh wlan show hostednetwork
if %errorlevel% neq 0 (
echo failed!
goto end
)
)
if "%iit%" lss "4" goto start
if "%iit%" gtr "4" goto start
:end
echo . > nul
转载于:https://www.cnblogs.com/arbboter/archive/2011/09/09/4225281.html