【问题标题】:Is there any command to display active Ethernet connection name?有没有显示活动以太网连接名称的命令?
【发布时间】:2021-10-07 14:48:56
【问题描述】:

我需要显示连接的以太网名称。

我使用以下命令获取 WLAN 连接网络(Wi-Fi)。

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

如果我接下来运行以下命令,则会输出错误消息:

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

The Wired AutoConfig Service (dot3svc) is not running.

但是我启动服务后,还是没有得到主动连接的以太网名称。

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.

谁能帮我在有线局域网连接上获得以太网名称Home

【问题讨论】:

  • 请尝试显示profiles 而不是interfaces%SystemRoot%\System32\netsh.exe LAN Show Profiles.
  • 这有帮助吗? wmicNIC get AdapterType,AdapterTypeId,Caption,DeviceID,Name,NetConnectionID,NetConnectionStatus,NetEnabled,PhysicalAdapter /VALUE
  • @Compo 当我使用配置文件时,我只得到这些详细信息而不是连接网络的名称! C:\WINDOWS\system32>%SystemRoot%\System32\netsh.exe LAN 显示配置文件配置文件版本:1 类型:有线 LAN 自动配置版本:1 802.1x:已启用 802.1x:未强制 EAP 类型:Microsoft:受保护的 EAP (PEAP) 802.1X 身份验证凭据:[配置文件凭据无效]缓存用户信息:[是]此设备上未安装机器配置文件。
  • @aschipfl 不!它不提供连接的网络名称。它仅显示适配器属性和详细信息

标签: cmd wifi ethernet ssid


【解决方案1】:

直接在 中输入的以下命令应在 Windows 8 / Server 2012 操作系统或更高版本上显示连接的网络配置文件的名称,无论它们是有线的还是无线的。

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

来自,对于 GUI 双击,它看起来更像这样:

@(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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-10-29
    • 2017-01-07
    • 2022-01-15
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多