简体   繁体   中英

Is there any command to display active Ethernet connection name?

I need to display connected Ethe.net 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 网络显示与名称为 HOME 的已连接 Wi-Fi 网络

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 Ethe.net 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 网络显示已连接有线 LAN 网络,名称为 Home

Can anyone help me to get the Ethe.net name Home on wired LAN connection?

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM