Laptop set wifi hotspot

 The company's wifi signal is too poor, what should I do if I want to turn my laptop into a hotspot? so easy

First of all, the laptop must have a wireless network card. Then

1. Run cmd as an administrator (if it is an administrator account, it should be run directly), enter the command netsh wlan set hostednetwork mode=allow ssid=justin (username) key=0123456789 (password), here is to generate and set up a wireless network connect

2. Open Network and Sharing Center > > Change Adapter Settings, then find the network you are connected to with the network (I call it Local Area Connection here), right-click Properties > > Sharing, check "Allow other network users to connect to the Internet through this computer's Internet connection." Connect" and select the newly generated wireless network connection. The role here is to share your wired broadband with wireless

3. Also run cmd as an administrator and enter the command netsh wlan start hostednetwork to enable network hosting

 

After using it for two days, I found that every time the computer hibernates, and then open the new wireless network connection, it disappears. It is easy to solve. Open the control panel > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > "

 

Then there is a problem. Every time you turn on the computer, you need to turn on the network bearer again.

The solution is to create a new bat file,

@echo off

runas /savecred /user:administrator "netsh wlan start hostednetwork" (if you are using an administrator account, I think this line will be changed to netsh wlan start hostednetwork or start cmd /c "netsh wlan start hostednetwrok", but I haven't tried it)

Copy these two lines of code into it, and execute it once. The password of your administrator account is required here (the purpose of executing it once is to save the account password, and then you don't need to enter the password every time)

Then put this bat file into the "startup" folder, and you're done!

 

The solution to the last problem is still a bit tortuous. The first idea is to write a bat file and put it on the startup disk. The idea is correct, but I have never written a bat file before, so the process of getting the above line of code is difficult.

First solve the problem of running cmd as an administrator (because I am not using the administrator account), the code solution is to run the code in cmd, runas /user:administrator cmd /k can open cmd as an administrator, that is, in Open cmd in cmd. But there is a problem that you have to enter the password every time. At this time, you can add the parameter /savecred after runas. The function of this is to save the password.

After that, the bat code is stuck on start cmd /c "runas /savecred /user:administrator cmd ". The function of this code is to open cmd and enter the code in the double quotation marks that follow. The function of the code inside is as mentioned above. So my idea at this time is to open cmd with bat, and open cmd with the administrator account in cmd, and then open the network hosting in this cmd. I don't know how to write this step. The key to solving the problem is that I found that runas is also an exe program, so I tried not to execute these codes in cmd, but run runas directly in bat, and it worked. In fact, during the period, I also thought about solving the administrator problem of the account (that is, giving my current account the same permissions as administrator to cmd), and then changing the code to start cmd /c "netsh wlan start hostednetwork", but in When you find cmd.exe in c:/Windows/System32, right click "Compatibility" under "Run this program as an administrator", the check box in front of "Run this program as an administrator", and the change permissions under Security are not available, so give up down this road

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326184154&siteId=291194637