cmdwifiethernetssid

Is there any command to display active Ethernet connection name?


I need to display connected Ethernet name.

I used the following command to get WLAN connected network (Wi-Fi).

C:\Users\User>netsh wlan show interface | findstr /i "SSID"  name
    SSID                   : HOME
    BSSID                  : bc:62:d2:4a:a1:48

Windows 10 network display with connected Wi-Fi network with name HOME

An error message is output if I run the following command next:

C:\Users\User>netsh lan show interface command

The Wired AutoConfig Service (dot3svc) is not running.

But after I started the service, I still do not get the active connected Ethernet name.

C:\Users\User>netsh lan show interface command

There is 1 interface on the system:

    Name             : Ethernet
    Description      : Realtek PCIe GbE Family Controller
    GUID             : e901d916-86f4-4070-9941-47a9a325537a
    Physical Address : 98-E7-43-0F-8F-84
    State            : Connected. Network does not support authentication.

Windows 10 network display with connected wired LAN network with name Home

Can anyone help me to get the Ethernet name Home on wired LAN connection?


Solution

  • The following command, entered directly in , should display the name of the connected network profile(s), regardless of whether they are wired or wireless, on a Windows 8 / Server 2012 Operating System or newer.

    For /F Tokens^=6^ Delims^=^" %G In ('%SystemRoot%\System32\wbem\WMIC.exe /NameSpace:\\Root\StandardCimv2 Path MSFT_NetConnectionProfile Where "IPv4Connectivity='4'" Get Name /Format:MOF 2^>NUL') Do @Echo %G
    

    From a , for GUI double-click, it would look a little more like this:

    @(For /F Tokens^=6^ Delims^=^" %%G In ('%SystemRoot%\System32\wbem\WMIC.exe
     /NameSpace:\\Root\StandardCimv2 Path MSFT_NetConnectionProfile Where
     "IPv4Connectivity='4'" Get Name /Format:MOF 2^>NUL') Do @Echo %%G) & Pause