Easily setup, turn on/off your laptop's hotspot - Pc tutorial

in #tutorial7 years ago

Hey guys whazzap, how are you guys doing?
Hopefully good, i am also doing good.

Today i will not talk too much, i will share a simple tool by which you will be able to setup/turn on/off your laptop's wifi hotspot. You can do it by cmd by typing a lot of commands but i am sharing a way by which you can easily setup/trun on/off hotspot of your laptop and can share the internet connect.

For doing so, copy the below texts and create a file and save it as .bat file.

@echo off
REM    Batch file for creating Wifi Hotspot
if _%1_==_payload_  goto :payload

:getadmin
    echo %~nx0: elevating self
    set vbs=%temp%\getadmin.vbs
    echo Set UAC = CreateObject^("Shell.Application"^)                >> "%vbs%"
    echo UAC.ShellExecute "%~s0", "payload %~sdp0 %*", "", "runas", 1 >> "%vbs%"
    "%temp%\getadmin.vbs"
    del "%temp%\getadmin.vbs"
goto :eof

:payload
    echo %~nx0: running payload with parameters:
    echo %*
    echo --------------------------------
    cd /d %2
    shift
    shift
    rem put your code here
    rem e.g.: perl myscript.pl %1 %2 %3 %4 %5 %6 %7 %8 %9
    :start
@ECHO off
ECHO  Pleae select one of the options
ECHO  -------------------------------
ECHO  1 Hotspot settings
ECHO  2 Start Hotspot
ECHO  3 Stop  Hotspot
ECHO  -------------------------------

SET /p option=Please enter one of the options:

if %option%==1  ( goto setup )      else set /a er=1
if %option%==2  ( goto start1 )      else set /a er=er+1
if %option%==3  ( goto stop )       else set /a er=er+1

:noOption
if %er% GEQ 3 ( 
Echo Error!
Echo Please enter a correct option
@pause
cls  
goto start
)

:setup
SET /p ssid=Please enter the Hotspot name:
SET /p key=Please enter the Hotspot password greater the 8 digits:
netsh wlan set hostednetwork mode=allow ssid=%ssid% key=%key% 
if %errorlevel%==0 (
ECHO Setup complete
)
@pause
cls  
goto start

:start1
netsh wlan start hostednetwork
@pause
cls  
goto start

:stop
netsh wlan stop hostednetwork
@pause
cls  
goto start
goto :eof

After saving it just double click to run it and it will ask administration permission after granting it cmd window with appear like below picture-


Screenshot_89.png

Then setup for the first time by selecting Hotspot settings. for selecting just type the mentioned number and press enter. Then just follow the guidance and set it up.
For turning on hotspot type 2 and for turning off type 3 and hit enter.

Don't forget to turn on networking sharing setting from your main network properties which you want to share. For doing so follow below pictures


Screenshot_90.png
Screenshot_91.png

After doing so, i hope u will be able to turn your pc's hotpot on easily and use on other devices. If you get any problem, let me know. I will try to answer and solve it.


This is the end of my blog. Thanks for reading my blog


Join our community where we help Bangladeshi writer and good content creator growing on steemit-




See you guys later.
Till then stay safe, be happy and keep doing good things.
To connect me on facebook click below gif-



Sort:  

wow great and helpful post.

Coin Marketplace

STEEM 0.09
TRX 0.30
JST 0.037
BTC 104356.97
ETH 3530.12
USDT 1.00
SBD 0.59