Search notes:

netsh wlan

Show available networks

If the wlansvc service is running, the following command shows the available networks:
C:\> netsh wlan show networks

Determining available WLAN profiles

netsh.exe can be used to show the available WLAN profiles:
C:\> netsh wlan show profile

Connect to a given WLAN profile

C:\> netsh wlan connect  PROFILE
C:\> netsh wlan connect "PROFILENAME WITH SPACES"
It's then also possible to disconnect from the connected profile with
C:\> netsh wlan disconnect
See also the batch file wlan.bat.

Show Wi-Fi passwords

If a WiFi password was forgotten, the stored password for a given WLAN profile can be revealed in a command line prompt such as cmd.exe. For example, if the profile name is Living Room:
C:\> netsh wlan show profile "Living Room" key=clear
Because the output is a bit verbose, the line that reveals the password can be searched for by piping the output of netsh into findstr.exe:
C:\> netsh wlan show profile "Living Room" key=clear | findstr.exe /c:"Key Content"
In a German installation of Windows, the text to search for is Schlüsselinhalt.

The Wireless AutoConfig Service (wlansvc) is not running

Apparently, the wlansvc service is required to discover networks. This service was not started in a VirtualBox installation of Windows:
C:\> netsh wlan show networks
The Wireless AutoConfig Service (wlansvc) is not running.

Opening a port and forwarding its incoming connections to an application listening a port

The following combination of netsh commands was helpful to me to open port 11521 and to forward it to an Oracle listener which listened on poart 1521:
netsh advfirewall firewall add rule name="Oracle Connections" dir=in action=allow protocol=TCP localport=11521
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=11521 connectaddress=localhost connectport=1521
In order to delete the firewall rule:
netsh advfirewall firewall delete rule name="Oracle Connections"

See also

netsh.exe
Connecting to a WLAN from a Windows Command Line
netsh wlan is used in the wlan-reconnect.ps1 script.
WLAN

Index