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