Thursday, 26 September 2013

WiFi Hotspot... To share LAN Internet connection on Android and other devices

AUTHOR: Bikram Pratap Banerjee                                     email: berserk8891@gmail.com
Hi, everyone this is my first post. I request all to use the "WiFi_Hotspot.bat" program to create Wi-Fi hotspot on their windows based machines. This is a very lightweight program (2 KB only) and can be used to share LAN based internet connection from your laptop to your android and other wifi enabled devices. The program works on the basic "netsh wlan set hostednetwork" protocol and command inbuilt in DOS ver. 6.1.7600. Go through the instructions to create hotspots properly. Enjoy... and do like my post if you find this interesting and useful.
Source code is given at the end for advance users.
INSTRUCTIONS:
  1. Connect your laptop to LAN and check internet settings (make sure web pages are displayed properly)
  2. Enable internet connection sharing via Wifi

o   Goto the system tray and open “Network and Sharing Center”

o   Click on the “Change adapter settings”


o   Right click on the LAN network and select Properties
o  If you want to share mobile based/dongle based internet connection through Hotspot right-click on the particular adapter then enable internet sharing for it - do not enable LAN based internet sharing because it will create conflict. After enabling internet sharing start your Dial-up connection and then run the program WiFi_Hotspot.bat

o   Go to settings tab and turn on internet sharing

o   Run “WiFi_Hotspot.bat” …… Enjoy

SOURCE CODE:
@echo off
REM AUTHOR: BIKRAM PRATAP BANERJEE, email: berserk8891@gmail.com
echo PROGRAM: WiFi_Hotspot
echo AUTHOR: BIKRAM PRATAP BANERJEE, email: berserk8891@gmail.com
echo *****************************************************************************
echo This program creates a WiFi-Hotspot in windows based machines. The created
echo hotspot can be used with Android and other wifi enabled devices. You can
echo also password protect your hotspot.
echo *****************************************************************************
echo [1] Simply Create Default WiFi Hotspot[Hotspot name:WiFi, Password:88888888]
echo [2] Configure WiFi Hotspot Profile
echo [3] Turnoff WiFi Hotspot
set /p id="Enter your choice:" %=%
echo Your choice:%id%
IF "%id%"=="1" (
  netsh wlan show drivers
  netsh wlan set hostednetwork mode=allow ssid=WiFi key=88888888
  netsh wlan start hostednetwork
  echo WiFi Hotspot created successfully....
) ELSE IF "%id%"=="2" (
GOTO Label2
) ELSE IF "%id%"=="3" (
  netsh wlan stop hostednetwork
  echo WiFi Hotspot stopped successfully....
) ELSE (
  echo BYE BYE....
)
PAUSE
GOTO End

:Label2
set /p hn="Enter WiFi Hotspot name:" %=%
set /p ps="Enter 8 digit WiFi Hotspot password:" %=%
netsh wlan show drivers
netsh wlan set hostednetwork mode=allow ssid=%hn% key=%ps%
netsh wlan start hostednetwork
echo WiFi Hotspot created successfully....
echo  WiFi Hotspot Name: %hn%
echo  WiFi Hotspot Password: %ps%
PAUSE
GOTO End



**Users are allowed to modify and distribute the source code
** Under no circumstances the developer would be claimed for the hardware or software damage incurred due to the use of the program

8 comments:

  1. I thank Rohit Kumar Singh and Gaurav Sing for letting me know about the "netsh wlan host" protocol inbuilt in Dos... I just created this for people who are unfamiliar and feel inconvenient with dos mode syntax execution

    ReplyDelete
  2. Sorry... it's Shashi Gaurav.... and I thank all my friends...

    ReplyDelete
  3. Hi everyone, you are required to run this program with administrator access. If you do not have administrative access just right click on the file “WiFi_Hotspot.bat” and click on ‘Run as Administrator’

    ReplyDelete
  4. Hi Bikram,

    I must admit that its very informative blog and I was able to create Hotstop without any issue after following your blog. But I have some issue after creating the HotSpot. I am able to share my internet (TataPhoton) via the Hotspot and as per the status of newely created network(as per your blog), I am able to see send and receive bytes, but still nothing is being loaded in my mobile. I have tried static IP as well, but no luck. Can you please let me know, what may the possible solution of same.

    Thanks In Advance !!!

    ReplyDelete
  5. Thank you Prashant for your interest... if you intend to share mobile based/dongle based internet connections over hotspot you are required to chose and enable sharing for the particular adapter... I have updated this post a bit with an additional image to have ease in understanding... as I found many other users to be interested in sharing there dongle based internet connection over hotspot...

    ReplyDelete
  6. Mr.B P Banerjee, i installed urs WiFI Hot spot... and follow the instruction given on ur blog..but i was not able to connect my laptop to my mobile. can u please help me out..with elaborative instructions..
    i will be very thankful to you.

    ReplyDelete
  7. Thanks Bikram... Now after yours help WiFi tool working and functioning very nicely.
    This small tool (WiFi Hot Spot) is very useful for free internet access in mobile... Please use it.

    ReplyDelete
  8. very good excellent. I love your blogs

    ReplyDelete