如何在Windows 7中使用批处理脚本获取本地连接名称

我正在编写一个简单的批处理脚本来检索Windows上的所有networking接口。 但是我只需要本地连接名称。 本地连接接口名称不是默认值。 有没有办法检索只有本地连接名称string与批处理脚本?

不完全确定你在问什么,但我想你的问题是你想获得网络接口的所有友好名称。

像这样的东西:

wmic nic where "netconnectionid like '%'" get netconnectionid 

返回(在我的笔记本电脑上)

 NetConnectionID Local Area Connection Wireless Network Connection Bluetooth Network Connection VirtualBox Host-Only Network 

对于现在正在积极连接的那个:

 C:\>wmic.exe nic where "NetConnectionStatus=2" get NetConnectionID |more +1 Local Area Connection 8 

为了更好地理解上述情况,请尝试:

 C:\>wmic.exe nic > 1.txt C:\>1.txt