("Internet Connection Sharing" must also be enabled for the selected adapter.)
Here is the description of the netsh hosted-network description:
C:\WINDOWS\system32>netsh wlan set hostednetwork
One or more parameters for the command are not correct or missing.
Usage: set hostednetwork [mode=]allow|disallow [ssid=]
[key=]
Parameters:
Tag Value
mode Specifies whether to allow or disallow the hosted network.
ssid SSID of the hosted network.
key The user security key used by the hosted network.
keyUsage Specifies whether the user security key is persistent or
temporary.
Remarks:
This command changes the properties of hosted network, including: SSID
of the hosted network, allow or disallow the hosted network in the system,
and a user security key that is used by the hosted network.
The user security key should be a string with 8 to 63 ASCII characters,
eg. a passphrase, or 64 hexadecimal digits which represent 32 binary
bytes.
If keyUsage is specified as persistent, the security key will be saved
and used when the hosted network is started again in future. Otherwise
it will be used only when the current or next time the hosted network
is started. Once the hosted network is stopped, the temporary security
key will be deleted from the system. If keyUsage is not specified, it
is persistent by default.
This command requires administrator privileges to allow or disallow the
hosted network.
Examples:
set hostednetwork mode=allow
set hostednetwork ssid=ssid1
set hostednetwork key=passphrase keyUsage=persistent
You can combine the parameters in one command.
The following shows a sample usage in order:
1. Settings for WLAN hotspot
netsh wlan set hostednetwork ssid=myLaptop key=mySecretKye93 keyUsage=persistent
2. Start hosted-network
netsh wlan start hostednetwork
3. Check the status
netsh wlan show hostednetwork
4. Stop hosted-network
netsh wlan stop hostednetwork