[英]Is there any command to display active Ethernet connection name?
I need to display connected Ethe.net name.我需要显示连接的 Ethe.net 名称。
I used the following command to get WLAN connected.network (Wi-Fi).我使用以下命令获取 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
An error message is output if I run the following command next:如果我接下来运行以下命令,错误消息为 output:
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.但是在我启动服务后,我仍然没有得到活动连接的 Ethe.net 名称。
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.
Can anyone help me to get the Ethe.net name Home
on wired LAN connection?谁能帮我在有线 LAN 连接上获取 Ethe.net 名称Home
?
The following command, entered directly in cmd , 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.直接在cmd中输入的以下命令应在 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
From a batch-file , for GUI double-click, it would look a little more like this:从批处理文件中,对于 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
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.