You are viewing a single comment's thread from:

RE: Musing Posts

in #musing-threads7 years ago (edited)

First of all you need to know if your laptop has a support for hotspot or not.
If yes then you can do it easily.


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

: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 Pleae select one of the options
ECHO -------------------------------
ECHO 1 Hotspot settings
ECHO 2 Start Hotspot
ECHO 3 Stop Hotspot
ECHO ------------------------------- @ECHO off

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

cls
goto start
) @pause

: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
)

cls
goto start @pause

:start1
netsh wlan start hostednetwork

cls
goto start @pause

:stop
netsh wlan stop hostednetwork

cls
goto start
goto :eof` @pause

copy the piece of code and paste it on notepad and save it as a bat file. After saving, system will ask for administration permission. Grant it. You will see a cmd window. Now type 1 and hit enter, then setup you hotspot as you want. after finishing you can start it by typing 2.
After starting hotspot go on Network and sharing center. Click on that connection which you are sharing. Now go to properties then click on sharing tab. On that tab check mark the sharing option and select that virtual hotspot which you created. Then save the setting pressing ok.
Now you can use this hotspot as wifi on other devices.
Few days ago i had written two post on this subject.
You can read further here
If you want to create hotspot by a software then follow this one here

Sort:  

Thanx, it worked. But i think creating with the software will be better.