Good time of day. I hope the topic is still alive.
There is such a problem, I am distributing Wi-Fi from a laptop, the Internet comes to it from a 4G modem.
I use these commands:
Cmd team
netsh wlan set hostednetwork mode = allow ssid = Wi-Fi key = 12345678 :: Create a virtual Wi-Fi access point
netsh wlan start hostednetwork :: START virtual wifi hotspot
netsh wlan stop hostednetwork :: STOP virtual Wi-Fi hotspots
netsh wlan set hostednetwork mode = disallow :: OFF Microsoft Virtual WiFi Mini Port Adapter
netsh wlan set hostednetwork mode = allow :: ON Microsoft Virtual WiFi Mini Port Adapter
netsh wlan show hostednetwork setting = security :: View password and other information (Only when a Wi-Fi network is running)
netsh wlan show hostednetwork :: Virtual Wi-Fi hotspot status information
netsh wlan show profiles :: View Wi-Fi to which you connected
But I was tired of constantly entering commands on the command line or using a separate .bat for each command and I decided to write .bat with the ability to select commands and the main undertaking I completed, a little later I wrote for myself the idea to make it for general use with help and opportunity solutions to most problems, and not just as now the main functions.
I wanted to make .bat understandable even to a full noob who knows how to click on the keys
And here is the .BAT itself
@echo off
@chcp 1251>nul
@TITLE WiFi Hotspot
: m1
Echo Select a program:
COLOR 1F
Echo
Echo 1 - Creating a Virtual Wi-Fi Access Point
Echo 2 - START Virtual Wi-Fi Hotspot
Echo 3 - STOP Virtual Wi-Fi Hotspot
Echo 4 - OFF Microsoft Virtual WiFi Mini Port Adapter
Echo 5 - ON Microsoft Virtual WiFi Mini Port Adapter
Echo 6 - View password and other information (Only when the Wi-Fi network is running)
Echo 7 - Virtual Wi-Fi hotspot status information
Echo 8 - View Wi-Fi to which you are connected
Echo? - Reference
Echo 0 - Exit
echo.
Set / p choice = "Your choice:"
if not defined choice goto m1
if "% choice%" == "1" (netsh wlan set hostednetwork mode = allow ssid = Wi-Fi key = h3jjWs7z-l9)
if "% choice%" == "2" (netsh wlan start hostednetwork)
if "% choice%" == "3" (netsh wlan stop hostednetwork)
if "% choice%" == "4" (netsh wlan set hostednetwork mode = disallow)
if "% choice%" == "5" (netsh wlan set hostednetwork mode = allow)
if "% choice%" == "6" (netsh wlan show hostednetwork setting = security)
if "% choice%" == "7" (netsh wlan show hostednetwork)
if "% choice%" == "8" (netsh wlan show profiles)
if "% choice%" == "?" (Echo Configuration and troubleshooting information.)
if "% choice%" == "0" (exit)
@pause
Echo
goto m1
pause>nul
By advice
LESHIY_ODESSA, I wanted to add commands under the spoiler:
To successfully raise a hotspot, it is necessary that:
1. Was launched - "WLAN Auto-Tuning Service"
sc config wlansvc start = auto :: startup type - "Automatic"
net start Wlansvc
2. The service was launched - "Internet Connection Sharing (ICS)"
:: sc config SharedAccess start = auto :: startup type - "Automatic"
net start SharedAccess
3. The service was launched - "Windows Firewall"
:: sc config MpsSvc start = auto :: startup type - "Automatic"
net start MpsSvc
It is also sometimes useful to enable the service, but to disable the firewall itself.
:: Disabling the firewall (we only need the service)
netsh advfirewall set allprofiles state off
But I ran into this problem: "To call additional help, type NET HELPMSG 2182"
This message does not bother me, but if you release this .bat to the network, many will be scared of this message.
I get this after almost every team on the advice
LESHIY_ODESSA, After executing "NET HELPMSG 2182" I get the answer that "The requested service is already running"
I would also like to be able to use the command "netsh wlan set hostednetwork mode = allow ssid = Wi-Fi key = 12345678 :: Create a virtual Wi-Fi access point" change "sside = and key =" directly in .bat without editing it through notepad
In stages, as I would like to see:
1. in CMD we type 1.
2. CMD offers us to set sside =
3. CMD offers us to set key =
4. CMD executes the command with given sside = and key =
It would be ideal if there was an opportunity to set .bat and this is with the choice of the Network adapter from which the virtual adapter will receive Internet
although I’ve already been upset that it’s impossible "But I still doubt that many system administrators use .bat to configure not all the basic routine work with these .bat"
I will be glad of any help or tip where I dig to implement the plannedPost has been editedalieksandr.ierokhin.95 - 03.12.17, 11:44Reason for editing: Supplement