Distribute wifi from a laptop using the command line. How to distribute Wi-Fi Internet using the Windows command line

In this article we will look at the method of transmitting WI-FI Internet using standard means operating system windows, namely with the help command line(CMD). This method tested on Windows 7 and Windows 8.

For a new operating room Windows systems 10 is also suitable (just find the command line, right click by the Windows logo icon, you will find it there).

Instructions for distributing WI-FI Internet.

1. Click the Start button (WIN+R) and in the " find programs and files" write ncpa.cpl and press " enter".



2. You should have a list available connections. Right click on wireless network and select " properties".


3. In the window that appears open tab "Access" and check the box next to the inscription " Allow other network users to use the Internet connection of this computer " and click the " button OK".


4. At this point, run Command Prompt as an administrator.
Windows 8 - WIN + X and select " command line (administrator)".
Windows 7 - go to start, find the command prompt program and right-click on it and select " run as administrator".



5. On the command line, run the command netsh wlan show drivers. Done, great, now look at the point " hosted network support", if supported, then you can continue to follow these instructions. If not, then try updating WIFI driver or install from the manufacturer itself.


6. At this stage, we make a router from a laptop. To do this, enter the following command
netsh wlan set hostednetwork mode = allow ssid = "jaswindows" key = "jaswin99"
In this line ssid = "you can enter your name here" key = "your wi-fi password is here."



7. After executing this command, you will see that access to the wireless network is open, the name and password have been changed. Now enter the following command
netsh wlan start hostednetwork




8. After running the previous command, you will see that the network you created is running. There is only one last step left until the finish line. Namely, enter the command at the end (it will allow you to find out the status of your wireless network, how many clients given time use your Internet)
netsh wlan show hostednetwork




9.
Finally, go to control Panel - network connections and in the properties of the connection you need allow me to use general access to internet connection.



That's all ready, you can use the Internet of the person distributing your laptop. To stop wi-fi internet distribution, enter the following command
netsh wlan stop hostednetwork

It is known that connecting any gadget: smartphone, laptop, tablet or other device to high-speed Internet via wifi is possible if you have a router.

But there are situations when there is no modem nearby, but the Internet is very necessary. IN in this case great solution The laptop will be used as a wifi modem.

Connection setup

Any laptop can be a point for accessing the Internet; it needs a built-in modem inside.

In this case, you can distribute wifi to other devices, but the network coverage may be small. The power of the built-in modem is not high enough.

For these purposes, you can resort to a special modem amplifier in a laptop.

But there are several methods for distributing Wi-Fi from a laptop: using Windows tools through the installation wizard, and access is carried out using applications and utilities.

Another method: you can distribute Wi-Fi from a laptop via the command line.

You can connect according to this principle. If you open a window at the bottom of the screen on the Start panel, you will see a line that is used to search for the desired program.

This is the line we need; with its help, Wi-Fi is distributed to devices. If you start typing the word "cmd" or "command. line" A program will pop up at the top of the window. this is who she is. Opens only "as administrator".


Open at the bottom of the Start screen


Then a black screen will open, and you should write the following characters there:

Netsh wlan set hostednetwork mode=allow ssid="Your name" key="your password"

Enter everything without quotes.



In ssid you name your network, it can be modified. Also don't forget to come up with strong password. But remember that this is not just a set of numbers.

After all, it is these numbers that contain the network password when connecting to the Internet. When you write it down, remember the password numbers and write it down. Feel free to press “Enter” now.

To start our network, you should enter “netsh wlan start hostednetwork” in the line. A message should appear stating that the newly created new network has been launched.




While the network is being launched, we carry out certain options so that the developed line has access to the Internet network.

So that all the necessary devices can be used as well. We find here in “Network Sharing Center” Connect button to connect this laptop, turn it on.

Switch to the “Properties” menu. In the access window, a command is indicated to allow the use of other devices and subsequently use this connection.

Finally, click on the new connection in the list. And the number and name will be indicated there.


As a result of the operations performed, it is possible to connect a variety of devices to the formed network. Smartphones, other laptops, tablets, computers, etc.

To connect, you must use the network password that was set earlier. New network accessible to the Internet, so other gadgets also connect to it.

Below is a list of necessary commands that allow you to manage the new network:

  • to start select “netsh wlan start hostednetwork”
  • monitoring the operation of “netsh wlan show hostednetwork”
  • termination of "netsh wlan stop hostednetwork"

Having stopped the distribution using the command, then we start it again.

After completing all these steps, the laptop needs to be rebooted. Try to enter startup commands immediately.

If an error was discovered during the process, then the network was never found. Information will instantly appear notifying you of this.

Let's correct this obstacle by introducing settings:

  • "netsh wlan set hostednetwork mode disallow";
  • "netsh wlan set hostednetwork mode-allow".

In the manager window there is network adapter, you need to find it and connect it. Team “to engage”. To see them, you need to go to “View” and check the box next to "Show hidden devices".


Automatic network start

After each reboot of the laptop, you will need to turn on the distribution again. Thus, it is possible to stop it using the command as presented above.

But it’s very inconvenient to enter data every time to start the network. You can set the wireless network to start automatically every time you turn on the system.

If you want to make sure that access starts automatically along with the system boot, then there is a guide.

A .bat file is created with the launch of the network, and is simply added to startup. When you turn on the laptop, it will automatically start and execute the command.

After all this, the laptop will begin to provide the Internet without your participation. And to create this, an access point must already be configured. and the Internet is distributed manually.

To do this, we create a new one on the desktop Text Document. Name it start_ wifi. bat. The main thing is to use the Latin alphabet and the part.bat., you can choose any name itself.

After renaming, it will change after right-clicking and selecting the “edit” command.

Open notepad, paste the command to run there, and save. For automatic installation Just add the file to startup.

The folder opens as follows: press the “Windows” and “R” keys together, then you will see startup - confirm. When the startup folder is open, copy the .bat file.

We reboot the laptop and we can see the command line flash on the monitor. This indicates that the access point is starting.

After these operations, you will be able to connect to the Internet via a wireless network even in the absence of a router.

Connection errors

Sometimes when trying to establish a wireless line, problems arise. The firewall may simply block access.

Other devices cannot access the Internet, but the network has been found. Disable your antivirus software for a while.

If, after turning it off, the connection to the network is established correctly, then it is necessary to supplement wifi connection to the list of connections in order to avoid blocking.

For example, in ESET Smart Security needs to do the following:

1 Open additional settings;


2 Open the “Network” tab and look at the "Custom firewall". To the region "Filtering mode" and there - "Interactive mode".