[英]Is there any command to display active Ethernet connection name?
我需要顯示連接的 Ethe.net 名稱。
我使用以下命令獲取 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
如果我接下來運行以下命令,錯誤消息為 output:
C:\Users\User>netsh lan show interface command
The Wired AutoConfig Service (dot3svc) is not running.
但是在我啟動服務后,我仍然沒有得到活動連接的 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.
誰能幫我在有線 LAN 連接上獲取 Ethe.net 名稱Home
?
直接在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
從批處理文件中,對於 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.