Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- @ECHO off
- :: Please create your hotspot first by running the command.
- :: Start "cmd", you will see "command prompt" as a result. right click and select "run as administrator"
- :: Copy paste: netsh wlan set hostednetwork mode=allow ssid=NAME key=PASSWORD
- :: change SSID to your desired Hotspot name and change PASSWORD to an 8-character password and hit ENTER.
- do this if your mobile device cannot get an IP and WIFI connection fails:
- 1) Disable Internet Connection Sharing from your modem connection -> properties -> Sharing Tab
- 2) Enable it again.
- 3) Disconnect from the Internet.
- 4) Reconnect again
- 5) Restart ICS service from the "services.msc" window.
- 6) Stop the hostednetwork
- 7) Start the hostednetwork
- 8) Internet Sharing is now enabled and everything gets resolved.
- @ECHO off
- :: Create a notification message; Disabled
- echo set WshShell = WScript.CreateObject("WScript.Shell") > %tmp%\tmp0.vbs
- echo WScript.Quit (WshShell.Popup( "Hotspot OFF" ,2 ,"Click OK", 0)) >> %tmp%\tmp0.vbs
- :: Create a notification message; Enabled
- echo set WshShell = WScript.CreateObject("WScript.Shell") > %tmp%\tmp1.vbs
- echo WScript.Quit (WshShell.Popup( "Hotspot ON" ,2 ,"Click OK", 0)) >> %tmp%\tmp1.vbs
- :: Check if the Hotspot is already on, if it is turn it off, otherwise turn it on.
- netsh wlan show hostednetwork | findstr /i "Channel"
- if %ERRORLEVEL% EQU 1 (
- C:\Windows\System32\netsh.exe wlan start hostednetwork
- ) else (
- C:\Windows\System32\netsh.exe wlan stop hostednetwork
- )
- :: Now do the same check but display a message showing the status of the Hotspot.
- netsh wlan show hostednetwork | findstr /i "Channel"
- if %ERRORLEVEL% EQU 1 (
- cscript /nologo %tmp%\tmp0.vbs
- ) else (
- cscript /nologo %tmp%\tmp1.vbs
- )
- :: Cleanup the notification message files
- DEL /F /S /Q /A %tmp%\tmp0.vbs
- DEL /F /S /Q /A %tmp%\tmp1.vbs
Add Comment
Please, Sign In to add comment