如何在Windows 7中使用批处理脚本获取本地连接名称 [英] How to get Local Area Connection Name with batch script in windows 7

查看:287
本文介绍了如何在Windows 7中使用批处理脚本获取本地连接名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个简单的批处理脚本来检索Windows上的所有网络接口.但是我只需要本地连接名称.本地连接接口名称不是默认值.是否有任何方法可以使用批处理脚本将本地连接名称检索为字符串?

I am writing a simple batch script to retrieve all the network interfaces on Windows. But I only need the Local Area Connection name. Local Area Connection interface name is not default. Is there any way to retrieve only Local Area connection name as string with a batch script?

推荐答案

不能完全确定您要问的是什么,但我想您的问题是您想获取网络接口的所有友好名称.

Not completely sure what you are asking, but I assume your question is you want to get all the friendly names of the network interfaces.

类似这样的东西:

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

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

which returns (on my laptop)

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

这篇关于如何在Windows 7中使用批处理脚本获取本地连接名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆