Quickly turn your laptop into a wireless WiFi shared hotspot script

Source: Internet
Author: User
Tags echo info sleep hosting

First, build WiFi sharing hotspot

The first step or according to the Convention, first in our notebook computer to build a WiFi wireless sharing hotspot, through the integration of BAT Program files can be one-step, high degree of autonomy, less operation steps, no brain operation!
(1) Create a new Start.bat file, copy the source program
First, create a new text document on your computer and copy the following large section of the program file into your text document and save it as Start.bat
SOURCE program:

The code is as follows Copy Code

@echo off

Echo Welcome to use wireless hotspot (WiFi) to build the program Wifiobat-http://www111cn.net

echo this program will automatically start to establish WiFi hotspot settings, please follow the interface prompts to complete the WiFi hotspot setup.
Echo now starts building WiFi hotspots ...

Echo will start the program after 3 seconds ...
echo Set ws = CreateObject ("Wscript.Shell") >sleep3.vbs
Echo Wscript.Sleep 3000>>sleep3.vbs
Sleep3.vbs
Del Sleep3.vbs

Echo is ready for WiFi settings, please press "enter" button! Exit Please close this window directly.
Pause
@echo off

Echo Info: Start testing whether the wireless network card supports the hosting network
Netsh wlan show drivers
echo Info: Please wait 3 seconds
echo Set ws = CreateObject ("Wscript.Shell") >sleep3.vbs
Echo Wscript.Sleep 3000>>sleep3.vbs
Sleep3.vbs
Del Sleep3.vbs

echo Info: Please check the above information to see if there is a "supported hosting network: Yes", if yes, continue, otherwise close this window.
echo Info: Press ENTER to start building WiFi hotspots, otherwise close the window!

Pause

@echo off

echo Info: Enable virtual WiFi network card
Netsh wlan set hostednetwork mode=allow

echo Info: Set up WiFi account
set/p user= Please set up WiFi account:
Netsh wlan set hostednetwork ssid=%user%
For%%i in (reader.txt) do echo WiFi account:%user% >>%%i

echo Info: Set up WiFi password
set/p keys= Please set WiFi password:
Netsh wlan set hostednetwork key=%keys%
For%%i in (reader.txt) do echo wifi password:%keys% >>%%i

Set ssn=www.zhuweisheng.com.cn
for/f "tokens=2 delims=="%%a in (' WMIC path Win32_OperatingSystem get Localdatetime/value ') do (set t=%%a)
Set nowtime=%t:~0,8%
For%%i in (reader.txt) do echo--set Date:%nowtime%--%ssn%-->>%%i

For%%i in (reader.txt) do echo. >>%%i

echo Info: Congratulations! WiFi hotspot set up, check the WiFi account password, please open reader.txt, if you need to modify the account password, please modify the Start.bat content.

echo Info: Please wait 5 seconds for information on the WiFi hotspots that are set up above.
echo Set ws = CreateObject ("Wscript.Shell") >sleep5.vbs
Echo Wscript.Sleep 5000>>sleep5.vbs
Sleep5.vbs
Del Sleep5.vbs

echo Info: Hot spots have been established, if required to start, please return to the car, or close the window!

Pause

echo Info: Start WiFi hotspot ...

@echo off
Echo Starts the hosting network (WiFi hotspot support enabled)

Netsh wlan start hostednetwork

echo if the above information shows "started Hosting network", the WiFi hotspot has started successfully!
echo, press ENTER to close this window!
Echo ————————————————————————-
echo If the information is "unable to start the hosting network", enable the hotspot by following these steps:
Echo 1. Open Change network adapter on the left side of network and sharing Center.
Echo 2. Open the Network Connections window,
Echo 3. Locate the "Microsoft Virtual WiFi Miniport Adapter" Wireless network connection 2 (or other name)
Echo 4. This is the WiFi hotspot we just created, and if the display is disabled, right-click to select Enable.
Echo 5. Restart this program.
Echo ————————————————————————-

Echo CreateObject ("SAPI.") SpVoice "). Speak "Congratulations, successfully opened wireless whyfine hotspot, Baidu" Zws "to get more information" >souce.vbs
Souce.vbs
Del Souce.vbs
ECHO has completed a WiFi hotspot build, open reader.txt to view the WiFi account password, enable broadband Connection Sharing according to the site tutorial.

Pause

(2) Run Start.bat to set up hot spots, check whether support hosting network

To run the start.bat you just saved, we see this interface:

Press ENTER to enter to check whether to support the "hosting network", pull the progress bar on the right side of the command window to the top, and see if the following words are available:
"Supported Hosting Network: Yes"


If not, then, sorry, your computer pinch, do not support this drip operation, you can turn off the command window to delete the bat file, move a small Mazar to be an audience bar ~
If so, continue to enter.

(3) Set up WiFi hotspot account password

Now come to the steps to enter the WiFi account, come and use the keyboard to knock Suisuinian go in to try (you die don't face, who want to write your rotten site name!) (┬_┬))


Also enter the WiFi password, you have completed the settings, continue to enter the bar ~


To view the set WiFi account (SSID) password, open the Reader.txt in the start directory and look at the image:

If you see "started Hosting network" and hear voice prompts, congratulations! Complete the WiFi hotspot Setup! Don't forget to return to the car!

Second, open the wireless network

If the end of run Start.bat does not show "started hosting network", we can do this:

1. Open "Start-control Panel-Network and internet--Network and Sharing Center"
2. Open change network adapter on the left side of network and sharing Center
3. In the Open Network Connections window, locate the Microsoft Virtual WiFi Miniport Adapter Wireless network connection 3 (or other name), as shown in the following figure:
"Note: This wireless network will be labeled with the wireless WiFi account you have set up, such as: Suisuinian"

4. This is the WiFi hotspot we just created, and if the display is disabled, right-click to select Enable.

Third, set up broadband and network sharing

1. In the Network Connections window, right-click a network connection that is connected to the Internet, such as our broadband connection
2. Select "Properties" → "share", tick "allow other connections (N)" and select "Wireless network Connection 3". Once identified, the "shared" word appears next to the shared network card icon, indicating that the broadband connection has been shared to wireless network connection 3.
As follows:


"Create Complete"
Thus far, we set up a series of notebooks for WiFi sharing hotspot on the ending, after the n+1 test, broken read this paragraph looks like tofu string code or quite effective drip, as long as the computer network, can be used as a mobile phone, flat WiFi, speed that is the lever drop!

Four, turn off WiFi hotspots

Eh, said to create and open a WiFi hotspot, I finished the "open" part of the next to say "off" part of the.
Turning off a WiFi hotspot is actually a reverse operation to create a WiFi hotspot.
Just a few lines of code:

  code is as follows copy code
@echo off  
Echo Info: Close the WiFi hotspot and make sure you press ENTER, otherwise close this window!  
pause 
Echo Info: Turn off the hosted network  
Netsh wlan stop hostednetwork 
Echo Info: The above message shows "stopped Download Network ", the WiFi hotspot has been closed!  
Echo Info: Please wait 3 seconds for processing time.  
Echo Set ws = CreateObject ("Wscript.Shell") >sleep3.vbs 
Echo Wscript.Sleep 3000>> sleep3.vbs 
sleep3.vbs 
del sleep3.vbs 
Echo Info: Turn off hotspots  
Netsh wlan set HOSTEDNETW Ork mode=disallow 
Echo Info: WiFi hotspots are turned off and hosting network ... 
pause 

Put this string of code into the new Stop.bat file, and then run Stop.bat, remember to press ENTER to confirm yo ~ ~

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.